/// <summary> /// A <see cref="WorkflowHubSubscriber"/> which contains the actions that send messages to the client is passed. /// <para>A <see cref="WorkflowBusSubscriber"/> is created and <see cref="WorkflowHubSubscriber"/> subscribes to it</para> /// </summary> /// <param name="correlationId">The correlation if for which the <see cref="WorkflowBusSubscriber"/> is created</param> /// <param name="clientSubscriber">The signalR subscriber</param> /// <param name="correlatedInstance">The service bus subscriber</param> public void WorkflowRelayStart(string correlationId, WorkflowHubSubscriber clientSubscriber, out WorkflowBusSubscriber correlatedInstance) { WorkflowBusSubscriber instance = new WorkflowBusSubscriber(correlationId); _correlatedInstances.TryAdd(correlationId, instance); instance.Subscribe(clientSubscriber); correlatedInstance = instance; }
/// <summary> /// Removes a <see cref="WorkflowBusSubscriber"/> and it's attached <see cref="WorkflowHubSubscriber"/> /// </summary> /// <param name="workflowCorrelatedBusSubscriber"></param> public void RemoveBusSubscriber(WorkflowBusSubscriber workflowCorrelatedBusSubscriber) { _correlatedInstances.TryRemove(workflowCorrelatedBusSubscriber.CorrelationId, out WorkflowBusSubscriber instance); instance?.Dispose(); }
// <summary> /// A <see cref="WorkflowHubSubscriber"/> which contains the actions that send messages to the client is passed. /// <para>A <see cref="WorkflowBusSubscriber"/> is searched in the list of saved subscribers /// </summary> /// <param name="correlationId">The correlation if for which the <see cref="WorkflowBusSubscriber"/> is created</param> /// <param name="clientSubscriber">The signalR subscriber</param> /// <param name="correlatedInstance">The service bus subscriber</param> /// <returns>Returns true if a busSubscriber was found. False otherwhise</returns> public bool WorkflowRelayResume(string correlationId, WorkflowHubSubscriber clientSubscriber, out WorkflowBusSubscriber correlatedInstance) { _correlatedInstances.TryGetValue(correlationId, out WorkflowBusSubscriber _correlatedInstance); if (!(_correlatedInstance is null)) { _correlatedInstance.SubscribeResume(clientSubscriber); correlatedInstance = _correlatedInstance; return(true); } correlatedInstance = null; return(false); }
public WorkflowBusSubscriberDoneArgs(WorkflowBusSubscriber instance) { Instance = instance; }