BackgroundService.ExecuteAsync(CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 System::Threading::Tasks::Task ^ ExecuteAsync(System::Threading::CancellationToken stoppingToken);
protected abstract System.Threading.Tasks.Task ExecuteAsync (System.Threading.CancellationToken stoppingToken);
abstract member ExecuteAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected MustOverride Function ExecuteAsync (stoppingToken As CancellationToken) As Task
Parameters
- stoppingToken
- CancellationToken
Triggered when StopAsync(CancellationToken) is called.
Returns
A Task that represents the long running operations.
Exceptions
The cancellation token was canceled. This exception is stored into the returned task.
Remarks
See Worker Services in .NET for implementation guidelines.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET