public void RemoveListener(Guid token) { if (_hub.IsSubscribed(token)) { _hub.Unsubscribe(token); } }
/// <inheritdoc /> protected override Task StopServiceAsync(CancellationToken cancellationToken) { // Unsubscribe all message hub subscriptions foreach (var token in _messageHubSubscriptions) { _messageHub.Unsubscribe(token); } return(Task.CompletedTask); }
/// <inheritdoc /> public Task StopAsync(CancellationToken cancellationToken) { // Unsubscribe all message hub subscriptions foreach (var token in _messageHubSubscriptions) { _messageHub.Unsubscribe(token); } return(Task.CompletedTask); }
public static IDisposable SubscribeDisposable <T>(this IMessageHub messageHub, Action <T> action) { var subId = messageHub.Subscribe(action); return(Disposable.Create(() => messageHub.Unsubscribe(subId))); }
public void Dispose() { _eventAggregator.Unsubscribe(_ticketScanAddedSubscription); _eventAggregator.Unsubscribe(_ticketScanUpdatedSubscription); }
public void Unsubscribe(int id) { messageHub.Unsubscribe(id); }