Show / Hide Table of Contents

Class KafkaBackgroundService

Inheritance
object
BackgroundService
KafkaBackgroundService
Implements
IHostedService
IDisposable
Inherited Members
BackgroundService.Dispose()
BackgroundService.StartAsync(CancellationToken)
BackgroundService.StopAsync(CancellationToken)
BackgroundService.ExecuteTask
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NotifyHub.NotificationService.Infrastructure.Workers
Assembly: NotifyHub.NotificationService.Infrastructure.dll
Syntax
public class KafkaBackgroundService : BackgroundService, IHostedService, IDisposable

Constructors

| Edit this page View Source

KafkaBackgroundService(ILogger<KafkaBackgroundService>, IKafkaConsumer<NotificationMessageDto>, IKafkaProducer<NotificationMessageDto>, IServiceScopeFactory)

Declaration
public KafkaBackgroundService(ILogger<KafkaBackgroundService> logger, IKafkaConsumer<NotificationMessageDto> consumer, IKafkaProducer<NotificationMessageDto> producer, IServiceScopeFactory scopeFactory)
Parameters
Type Name Description
ILogger<KafkaBackgroundService> logger
IKafkaConsumer<NotificationMessageDto> consumer
IKafkaProducer<NotificationMessageDto> producer
IServiceScopeFactory scopeFactory

Methods

| Edit this page View Source

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.

Declaration
protected override Task ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

A Task that represents the long running operations.

Overrides
BackgroundService.ExecuteAsync(CancellationToken)
Remarks

See Worker Services in .NET for implementation guidelines.

Implements

IHostedService
IDisposable
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX