Table of Contents

Class MessageConsumerJobBase<T>

Namespace
The.Web.Jobs
Assembly
Instagile.Web.Client.dll
public abstract class MessageConsumerJobBase<T> : JobBase, IHostedService, IDisposable

Type Parameters

T
Inheritance
MessageConsumerJobBase<T>
Implements
Inherited Members

Constructors

MessageConsumerJobBase(JobParameters)

protected MessageConsumerJobBase(JobParameters parameters)

Parameters

parameters JobParameters

Properties

CanExecute

public override bool CanExecute { get; }

Property Value

bool

Methods

CreateChannel(IServiceCollection)

Registers an IMessageChannel<T> singleton and returns it for direct use.

public static IMessageChannel<T> CreateChannel(IServiceCollection services)

Parameters

services IServiceCollection

Returns

IMessageChannel<T>

ExecuteAsync(CancellationToken)

This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Triggered when StopAsync(CancellationToken) is called.

Returns

Task

A Task that represents the long running operations.

Remarks

See Worker Services in .NET for implementation guidelines.

ExecuteJobAsync(IServices, IPrincipal, IProgress<Status>, CancellationToken)

Implements the actual job logic.

protected override sealed Task ExecuteJobAsync(IServices services, IPrincipal principal, IProgress<Status> progress, CancellationToken cancellationToken)

Parameters

services IServices
principal IPrincipal
progress IProgress<Status>
cancellationToken CancellationToken

Returns

Task

ExecuteJobAsync(IServices, IPrincipal, IProgress<Status>, T, CancellationToken)

Implements the actual job logic.

protected abstract Task ExecuteJobAsync(IServices services, IPrincipal principal, IProgress<Status> progress, T message, CancellationToken cancellationToken)

Parameters

services IServices
principal IPrincipal
progress IProgress<Status>
message T
cancellationToken CancellationToken

Returns

Task