public PipelineDispatcherHook(
     IMessagingHost messagingHost)
 {
     _messagingHost  = messagingHost;
     _channelGroup   = _messagingHost.Initialize();
     _messageChannel = _channelGroup.OpenChannel();
 }
Exemplo n.º 2
0
 public MessagingHostService(IMessagingHost messagingHost)
 {
     _messagingHost = messagingHost;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Attempts to gracefully stop the host with the given timeout.
 /// </summary>
 /// <param name="host">The <see cref="IMessagingHost"/> to stop.</param>
 /// <param name="timeout">The timeout for stopping gracefully. Once expired the
 /// server may terminate any remaining active connections.</param>
 /// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
 public static async Task StopAsync(this IMessagingHost host, TimeSpan timeout)
 {
     using CancellationTokenSource cts = new CancellationTokenSource(timeout);
     await host.StopAsync(cts.Token).ConfigureAwait(false);
 }