Example #1
0
        public async Task <IDictionary <string, object> > Do(
            IDictionary <string, object> stepParameters,
            IDictionary <string, object> pluginParameters)
        {
            try
            {
                Log.Information($"Stop connections...");

                // Get parameters
                stepParameters.TryGetTypedValue(SignalRConstants.Type, out string type, Convert.ToString);

                pluginParameters.TryGetTypedValue($"{SignalRConstants.ConnectionStore}.{type}",
                                                  out IList <IHubConnectionAdapter> connections, (obj) => (IList <IHubConnectionAdapter>)obj);
                // Stop the possible scanner
                StopRapirConnectionScanner(stepParameters, pluginParameters);
                // Stop connections
                await Task.WhenAll(from connection in connections
                                   select connection.StopAsync());

                await SignalRUtils.StopNegotiationServer(stepParameters, pluginParameters);

                await SignalRUtils.StopInternalAppServer(stepParameters, pluginParameters);

                return(null);
            }
            catch (Exception ex)
            {
                var message = $"Fail to stop connections: {ex}";
                Log.Error(message);
                throw;
            }
        }