Table of Contents

Class ApiLifecyclePublisher

Namespace
Virtufin.WorkManager.Services
Assembly
Virtufin.WorkManager.dll

Publishes worker lifecycle events to the virtufin-api's system-events topic. Events are CloudEvents v1.0 envelopes with the WorkManager's URN as the source. The publisher is best-effort: failures are logged but never propagated, so an unreachable API does not break the WorkManager's worker state machine.

public class ApiLifecyclePublisher
Inheritance
ApiLifecyclePublisher
Inherited Members

Constructors

ApiLifecyclePublisher(ILogger<ApiLifecyclePublisher>, PubsubClient)

public ApiLifecyclePublisher(ILogger<ApiLifecyclePublisher> logger, Pubsub.PubsubClient pubsub)

Parameters

logger ILogger<ApiLifecyclePublisher>
pubsub Pubsub.PubsubClient

Methods

PublishWorkerEventAsync(string, Guid, string?, string?, Exception?, CancellationToken)

public Task PublishWorkerEventAsync(string type, Guid workerId, string? group, string? topic, Exception? error = null, CancellationToken cancellationToken = default)

Parameters

type string
workerId Guid
group string
topic string
error Exception
cancellationToken CancellationToken

Returns

Task