Class PubsubSubscriptionManager
public class PubsubSubscriptionManager : SubscriptionManagerBase<SubscribeResponse, PubsubSubscription>
- Inheritance
-
PubsubSubscriptionManager
- Inherited Members
Constructors
PubsubSubscriptionManager(ILogger<PubsubSubscriptionManager>)
public PubsubSubscriptionManager(ILogger<PubsubSubscriptionManager> logger)
Parameters
loggerILogger<PubsubSubscriptionManager>
Methods
BroadcastToTopicAsync(string, SubscribeResponse)
public Task BroadcastToTopicAsync(string topic, SubscribeResponse response)
Parameters
topicstringresponseSubscribeResponse
Returns
GetAllSubscriptions()
public IEnumerable<KeyValuePair<string, ConcurrentDictionary<string, PubsubSubscription>>> GetAllSubscriptions()
Returns
GetIdleTimeout(PubsubSubscription)
Gets the idle timeout for a subscription.
protected override TimeSpan GetIdleTimeout(PubsubSubscription subscription)
Parameters
subscriptionPubsubSubscriptionThe 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
subscriptionPubsubSubscriptionThe 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
subscriptionPubsubSubscriptionThe subscription to send to.
evtSubscribeResponseThe event to send.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Subscribe(string, ChannelWriter<SubscribeResponse>)
public string Subscribe(string topic, ChannelWriter<SubscribeResponse> writer)
Parameters
topicstringwriterChannelWriter<SubscribeResponse>
Returns
UnsubscribeById(string)
public void UnsubscribeById(string subscriptionId)
Parameters
subscriptionIdstring