Search Results for

    Show / Hide Table of Contents

    Interface IJobTracker<TCommand>

    the interface defining a job tracker

    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public interface IJobTracker<TCommand> where TCommand : ICommandBase
    Type Parameters
    Name Description
    TCommand

    the command type of the job

    Methods

    CancelJobAsync(Guid, CancellationToken)

    cancel a job by its tracking id. if the job is currently executing, the cancellation token passed down to the command handler method will be notified of the cancellation. the job storage record will also be marked complete via CancelJobAsync(Guid, CancellationToken) method of the job storage provider, which will prevent the job from being picked up for execution.

    Declaration
    Task CancelJobAsync(Guid trackingId, CancellationToken ct = default)
    Parameters
    Type Name Description
    Guid trackingId

    the job tracking id

    CancellationToken ct

    optional cancellation token

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    Exception

    this method will throw any exceptions that the job storage provider may throw in case of transient errors. you can safely retry calling this method repeatedly with the same tracking id.

    GetJobResultAsync<TResult>(Guid, CancellationToken)

    retrieve the result of a command (that returns a result) which was previously queued as a job. the returned result will be null/default until the job is actually complete.

    Declaration
    Task<TResult?> GetJobResultAsync<TResult>(Guid trackingId, CancellationToken ct = default)
    Parameters
    Type Name Description
    Guid trackingId

    the job tracking id

    CancellationToken ct

    cancellation token

    Returns
    Type Description
    Task<TResult>
    Type Parameters
    Name Description
    TResult

    the type of the expected result

    StoreJobResultAsync<TResult>(Guid, TResult, CancellationToken)

    this method can be used to either store a preliminary job result and/or job progress before the job execution fully completes.

    Declaration
    Task StoreJobResultAsync<TResult>(Guid trackingId, TResult result, CancellationToken ct = default) where TResult : IJobResult
    Parameters
    Type Name Description
    Guid trackingId

    the job tracking id

    TResult result

    the preliminary job result or progress to store

    CancellationToken ct

    cancellation token

    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    TResult

    the type of the preliminary result or progress

    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX