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
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)
Removes a subscriber by id. Returns true if a subscriber was found and
removed, false if the id matched nothing -- callers need to be able to
tell those apart, otherwise Unsubscribe reports success for any string.
public bool UnsubscribeById(string subscriptionId)
Parameters
subscriptionIdstring