private async Task Terminate() { foreach (var subscription in Subscriptions) { await Subscriptions.UnsubscribeAsync(subscription.Id); } await TransportReader.Complete(); }
public async Task Terminate() { foreach (var subscription in Subscriptions) { await Subscriptions.UnsubscribeAsync(subscription.Id).ConfigureAwait(false); } // this should propagate to handler completion await TransportReader.Complete().ConfigureAwait(false); }
private void LinkToTransportReader() { _logger.LogDebug("Creating reader pipeline"); TransportReader = Transport.Reader; _handler = new ActionBlock <OperationMessage>(HandleMessageAsync, new ExecutionDataflowBlockOptions { EnsureOrdered = true, BoundedCapacity = 1 }); TransportReader.LinkTo(_handler); _logger.LogDebug("Reader pipeline created"); }