Table of Contents

Class BackgroundService

Namespace
Acuit.Pinpoint.Hosting
Assembly
Acuit.Pinpoint.Hosting.dll

Base class for implementing a long running IHostedService.

public abstract class BackgroundService : IHostedService, IDisposable
Inheritance
BackgroundService
Implements
Inherited Members

Methods

Dispose()

public virtual void Dispose()

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 abstract Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Triggered when StopAsync(CancellationToken) is called.

Returns

Task

A Task that represents the long running operations.

StartAsync(CancellationToken)

Triggered when the application host is ready to start the service.

public virtual Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the start process has been aborted.

Returns

Task

StopAsync(CancellationToken)

Triggered when the application host is performing a graceful shutdown.

public virtual Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Indicates that the shutdown process should no longer be graceful.

Returns

Task