Table of Contents

Interface IAsyncStreamEventHandler

Namespace
Virtufin.Api.Client
Assembly
Virtufin.Api.Client.dll

Async callback interface for receiving stream events. Handlers that implement this interface are awaited by SubscribeAsync(IStreamEventHandler, IEnumerable<string>?, IEnumerable<string>?, IEnumerable<string>?, CancellationToken), preventing slow handlers from causing gRPC stream backpressure.

public interface IAsyncStreamEventHandler : IStreamEventHandler
Inherited Members

Methods

OnErrorAsync(Exception, CancellationToken)

Called when an error occurs in the event stream. Awaited by the stream loop.

Task OnErrorAsync(Exception ex, CancellationToken cancellationToken = default)

Parameters

ex Exception

The exception that occurred.

cancellationToken CancellationToken

Cancellation token for the stream.

Returns

Task

OnEventAsync(TopicEventRequest, CancellationToken)

Called when a regular event is received. Awaited by the stream loop.

Task OnEventAsync(TopicEventRequest e, CancellationToken cancellationToken = default)

Parameters

e TopicEventRequest

The topic event request containing event data.

cancellationToken CancellationToken

Cancellation token for the stream.

Returns

Task