Table of Contents

Class PubsubSubscriptionManager

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll
public class PubsubSubscriptionManager : SubscriptionManagerBase<SubscribeResponse, PubsubSubscription>
Inheritance
PubsubSubscriptionManager
Inherited Members

Constructors

PubsubSubscriptionManager(ILogger<PubsubSubscriptionManager>)

public PubsubSubscriptionManager(ILogger<PubsubSubscriptionManager> logger)

Parameters

logger ILogger<PubsubSubscriptionManager>

Methods

BroadcastToTopicAsync(string, SubscribeResponse)

public Task BroadcastToTopicAsync(string topic, SubscribeResponse response)

Parameters

topic string
response SubscribeResponse

Returns

Task

GetAllSubscriptions()

public IEnumerable<KeyValuePair<string, ConcurrentDictionary<string, PubsubSubscription>>> GetAllSubscriptions()

Returns

IEnumerable<KeyValuePair<string, ConcurrentDictionary<string, PubsubSubscription>>>

GetIdleTimeout(PubsubSubscription)

Gets the idle timeout for a subscription.

protected override TimeSpan GetIdleTimeout(PubsubSubscription subscription)

Parameters

subscription PubsubSubscription

The subscription to get the timeout for.

Returns

TimeSpan

The idle timeout duration.

GetSubscriptionKey(PubsubSubscription)

Gets the subscription key for a subscription.

protected override string GetSubscriptionKey(PubsubSubscription subscription)

Parameters

subscription PubsubSubscription

The subscription to get the key for.

Returns

string

The subscription key string.

SendEventAsync(PubsubSubscription, SubscribeResponse, CancellationToken)

Sends an event to a subscription.

protected override Task SendEventAsync(PubsubSubscription subscription, SubscribeResponse evt, CancellationToken cancellationToken)

Parameters

subscription PubsubSubscription

The subscription to send to.

evt SubscribeResponse

The event to send.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

Subscribe(string, ChannelWriter<SubscribeResponse>)

public string Subscribe(string topic, ChannelWriter<SubscribeResponse> writer)

Parameters

topic string
writer ChannelWriter<SubscribeResponse>

Returns

string

UnsubscribeById(string)

public void UnsubscribeById(string subscriptionId)

Parameters

subscriptionId string