public async Task Start(CancellationToken cancellationToken) { var subs = _subscriptionFactory.CreateAllAvailableSubscriptions(); var tasks = new List <Task>(); foreach (var messageSubscriber in subs) { _subscriptionManager.AddSubscriber(messageSubscriber); tasks.Add(_subscriptionManager.StartSubscriber(messageSubscriber.Id)); } await Task.WhenAll(tasks); }
public async Task <IHttpActionResult> Start(Guid id) { await _subscriptionManager.StartSubscriber(id); return(Ok()); }