Esempio n. 1
0
 public HttpHostConfiguration(IHttpBusConfiguration busConfiguration, IHttpTopologyConfiguration topologyConfiguration)
     : base(busConfiguration)
 {
     _busConfiguration      = busConfiguration;
     _hostSettings          = new ConfigurationHostSettings();
     _topologyConfiguration = topologyConfiguration;
 }
Esempio n. 2
0
 public HttpConsumerFilter(HttpHostSettings hostSettings, ReceiveSettings receiveSettings,
                           HttpReceiveEndpointContext context)
 {
     _hostSettings    = hostSettings;
     _receiveSettings = receiveSettings;
     _context         = context;
 }
        public KestrelHttpHostContext(HttpHostSettings settings, CancellationToken cancellationToken)
            : base(new PayloadCache(), cancellationToken)
        {
            HostSettings = settings;

            _endpoints = new SortedDictionary <string, List <Endpoint> >(StringComparer.OrdinalIgnoreCase);
        }
        public IHttpHost Host(HttpHostSettings settings)
        {
            var httpHost = new HttpHost(settings);

            _hosts.Add(httpHost);

            return(httpHost);
        }
Esempio n. 5
0
        public HttpHost(HttpHostSettings hostSettings, IHostTopology topology)
        {
            _settings = hostSettings;
            Topology  = topology;

            ReceiveEndpoints = new ReceiveEndpointCollection();

            _httpHostCache = new HttpHostCache(Settings);
        }
        public IHttpHost Host(HttpHostSettings settings)
        {
            var hostTopology = new HttpHostTopology(_busEndpointConfiguration.Topology);

            var host = new HttpHost(settings, hostTopology);

            _configuration.CreateHostConfiguration(host);

            return(host);
        }
        public IHttpHost Host(HttpHostSettings settings)
        {
            var hostTopology = new HttpHostTopology(_configuration.Topology);

            var httpHost = new HttpHost(settings, hostTopology);

            _hosts.Add(httpHost);

            return(httpHost);
        }
Esempio n. 8
0
        public HttpHostConfiguration(IHttpBusConfiguration busConfiguration, HttpHostSettings settings, IHostTopology hostTopology)
        {
            _busConfiguration = busConfiguration;
            _settings         = settings;
            _hostTopology     = hostTopology;

            HostAddress = settings.GetInputAddress();

            _host = new HttpHost(this);
        }
Esempio n. 9
0
        public HttpConsumer(HttpHostSettings settings, HttpReceiveEndpointContext context)
        {
            _context = context;

            _tracker          = new DeliveryTracker(OnDeliveryComplete);
            _inputAddress     = context.InputAddress;
            _deliveryComplete = new TaskCompletionSource <bool>();

            SetReady();
        }
Esempio n. 10
0
        public IHttpHostConfiguration CreateHostConfiguration(HttpHostSettings settings)
        {
            var hostTopology = new HttpHostTopology(_topologyConfiguration);

            var hostConfiguration = new HttpHostConfiguration(this, settings, hostTopology);

            _hosts.Add(hostConfiguration);

            return(hostConfiguration);
        }
Esempio n. 11
0
 public HttpConsumerFilter(IPipe <ReceiveContext> receivePipe, IReceiveObserver receiveObserver, IReceiveTransportObserver transportObserver,
                           HttpHostSettings hostSettings, ReceiveSettings receiveSettings, HttpReceiveEndpointContext context)
 {
     _receivePipe       = receivePipe;
     _receiveObserver   = receiveObserver;
     _transportObserver = transportObserver;
     _hostSettings      = hostSettings;
     _receiveSettings   = receiveSettings;
     _context           = context;
 }
Esempio n. 12
0
        public static Uri GetInputAddress(this HttpHostSettings hostSettings)
        {
            var builder = new UriBuilder
            {
                Scheme = hostSettings.Scheme,
                Host   = hostSettings.Host,
                Port   = hostSettings.Port,
            };

            return(builder.Uri);
        }
Esempio n. 13
0
        public HttpConsumer(IReceiveObserver receiveObserver, HttpHostSettings settings, IPipe <ReceiveContext> receivePipe, HttpReceiveEndpointContext context)
        {
            _receiveObserver = receiveObserver;
            _receivePipe     = receivePipe;
            _context         = context;

            _tracker          = new DeliveryTracker(OnDeliveryComplete);
            _inputAddress     = settings.GetInputAddress();
            _deliveryComplete = new TaskCompletionSource <bool>();

            SetReady();
        }
        /// <summary>
        /// Adds a RabbitMQ Basic Consumer to the pipeline
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="receivePipe"></param>
        /// <param name="settings"></param>
        /// <param name="receiveSettings"></param>
        /// <param name="receiveObserver"></param>
        /// <param name="receiveTransportObserver"></param>
        /// <param name="supervisor"></param>
        /// <param name="sendPipe"></param>
        public static void HttpConsumer(this IPipeConfigurator<OwinHostContext> configurator, IPipe<ReceiveContext> receivePipe, HttpHostSettings settings,
            ReceiveSettings receiveSettings,
            IReceiveObserver receiveObserver, IReceiveTransportObserver receiveTransportObserver, ITaskSupervisor supervisor,
            ISendPipe sendPipe)
        {
            if (configurator == null)
                throw new ArgumentNullException(nameof(configurator));

            var pipeBuilderConfigurator = new HttpConsumerPipeSpecification(settings, receiveSettings, receivePipe, receiveObserver, receiveTransportObserver,
                supervisor, sendPipe);

            configurator.AddPipeSpecification(pipeBuilderConfigurator);
        }
Esempio n. 15
0
        public HttpHost(HttpHostSettings hostSettings)
        {
            _settings = hostSettings;

            //exception Filter
            ReceiveEndpoints = new ReceiveEndpointCollection();

            //connection retry policy

            _supervisor = new TaskSupervisor($"{TypeMetadataCache<HttpHost>.ShortName} - {Settings.Host}");

            _owinHostCache = new OwinHostCache(Settings, _supervisor);
        }
Esempio n. 16
0
        public static Uri GetSendAddress(this HttpHostSettings hostSettings, HttpSendSettings sendSettings)
        {
            var builder = new UriBuilder
            {
                Scheme = "http",
                Host   = hostSettings.Host,
                Port   = hostSettings.Port,
                Path   = sendSettings.Path
            };

            builder.Query += string.Join("&", GetQueryStringOptions(sendSettings));

            return(builder.Uri);
        }
Esempio n. 17
0
        public HttpConsumerAction(IReceiveObserver receiveObserver, HttpHostSettings settings, IPipe <ReceiveContext> receivePipe, ITaskScope taskSupervisor,
                                  IHttpReceiveEndpointTopology topology)
        {
            _receiveObserver = receiveObserver;
            _receivePipe     = receivePipe;
            _topology        = topology;

            _tracker          = new DeliveryTracker(OnDeliveryComplete);
            _inputAddress     = settings.GetInputAddress();
            _participant      = taskSupervisor.CreateParticipant($"{TypeMetadataCache<HttpConsumerAction>.ShortName} - {_inputAddress}", Stop);
            _deliveryComplete = new TaskCompletionSource <bool>();

            _participant.SetReady();
        }
 public HttpConsumerPipeSpecification(HttpHostSettings hostSettings,
                                      ReceiveSettings receiveSettings,
                                      IPipe <ReceiveContext> receivePipe,
                                      IReceiveObserver receiveObserver,
                                      IReceiveTransportObserver transportObserver,
                                      ITaskSupervisor supervisor, IHttpReceiveEndpointTopology topology)
 {
     _hostSettings      = hostSettings;
     _receiveSettings   = receiveSettings;
     _receivePipe       = receivePipe;
     _receiveObserver   = receiveObserver;
     _transportObserver = transportObserver;
     _supervisor        = supervisor;
     _topology          = topology;
 }
Esempio n. 19
0
 public HttpConsumerFilter(IPipe <ReceiveContext> receivePipe,
                           IReceiveObserver receiveObserver,
                           IReceiveTransportObserver transportObserver,
                           ITaskSupervisor supervisor,
                           HttpHostSettings hostSettings,
                           ReceiveSettings receiveSettings,
                           ISendPipe sendPipe)
 {
     _receivePipe       = receivePipe;
     _receiveObserver   = receiveObserver;
     _transportObserver = transportObserver;
     _supervisor        = supervisor;
     _hostSettings      = hostSettings;
     _receiveSettings   = receiveSettings;
     _sendPipe          = sendPipe;
 }
        HttpOwinHostContext(HttpHostSettings settings, ITaskParticipant participant)
            : base(new PayloadCache(), participant.StoppedToken)
        {
            HostSettings = settings;
            _participant = participant;

            _endpoints = new SortedDictionary<string, List<Endpoint>>(StringComparer.OrdinalIgnoreCase);

            _options = new StartOptions
            {
                Port = HostSettings.Port
            };

            _options.Urls.Add(HostSettings.Host);

            _participant.SetReady();
        }
Esempio n. 21
0
        HttpOwinHostContext(HttpHostSettings settings, ITaskParticipant participant)
            : base(new PayloadCache(), participant.StoppedToken)
        {
            HostSettings = settings;
            _participant = participant;

            _endpoints = new SortedDictionary <string, List <Endpoint> >(StringComparer.OrdinalIgnoreCase);

            _options = new StartOptions
            {
                Port = HostSettings.Port
            };

            _options.Urls.Add(HostSettings.Host);

            _participant.SetReady();
        }
        public HttpConsumerAction(IReceiveObserver receiveObserver,
            HttpHostSettings settings,
            ReceiveSettings receiveSettings,
            IPipe<ReceiveContext> receivePipe,
            ITaskScope taskSupervisor,
            ISendPipe sendPipe)
        {
            _receiveObserver = receiveObserver;
            _receiveSettings = receiveSettings;
            _receivePipe = receivePipe;
            _sendPipe = sendPipe;

            _tracker = new DeliveryTracker(OnDeliveryComplete);
            _inputAddress = settings.GetInputAddress();
            _participant = taskSupervisor.CreateParticipant($"{TypeMetadataCache<HttpConsumerAction>.ShortName} - {_inputAddress}", Stop);
            _deliveryComplete = new TaskCompletionSource<bool>();

            _participant.SetReady();
        }
 public HttpOwinHostContext(HttpHostSettings settings, ITaskSupervisor supervisor)
     : this(settings, supervisor.CreateParticipant($"{TypeMetadataCache<HttpOwinHostContext>.ShortName} - {settings.ToDebugString()}"))
 {
 }
        /// <summary>
        /// Adds a RabbitMQ Basic Consumer to the pipeline
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="receivePipe"></param>
        /// <param name="settings"></param>
        /// <param name="receiveSettings"></param>
        /// <param name="receiveObserver"></param>
        /// <param name="receiveTransportObserver"></param>
        /// <param name="supervisor"></param>
        /// <param name="topology"></param>
        public static void HttpConsumer(this IPipeConfigurator <OwinHostContext> configurator, IPipe <ReceiveContext> receivePipe, HttpHostSettings settings,
                                        ReceiveSettings receiveSettings, IReceiveObserver receiveObserver, IReceiveTransportObserver receiveTransportObserver, ITaskSupervisor supervisor, IHttpReceiveEndpointTopology topology)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var pipeBuilderConfigurator = new HttpConsumerPipeSpecification(settings, receiveSettings, receivePipe, receiveObserver, receiveTransportObserver,
                                                                            supervisor, topology);

            configurator.AddPipeSpecification(pipeBuilderConfigurator);
        }
        public IHttpHost Host(HttpHostSettings settings)
        {
            var hostConfiguration = _configuration.CreateHostConfiguration(settings);

            return(hostConfiguration.Host);
        }
Esempio n. 26
0
            public OwinHostScope(ITaskScope scope, HttpHostSettings settings)
            {
                _owinHostContext = new TaskCompletionSource <HttpOwinHostContext>();

                _taskScope = scope.CreateScope($"{TypeMetadataCache<OwinHostScope>.ShortName} - {settings.ToDebugString()}", CloseContext);
            }
 public void Host(HttpHostSettings settings)
 {
     _busConfiguration.HostConfiguration.Settings = settings;
 }
Esempio n. 28
0
 public HttpHostCache(HttpHostSettings settings)
     : base(new HttpHostContextFactory(settings))
 {
 }
Esempio n. 29
0
 public HttpHostContextFactory(HttpHostSettings settings)
 {
     _settings = settings;
 }
Esempio n. 30
0
        public OwinHostCache(HttpHostSettings settings, ITaskSupervisor supervisor)
        {
            _settings = settings;

            _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<OwinHostCache>.ShortName} - {settings.ToDebugString()}", CloseScope);
        }
Esempio n. 31
0
            public OwinHostScope(ITaskScope scope, HttpHostSettings settings)
            {
                _owinHostContext = new TaskCompletionSource<HttpOwinHostContext>();

                _taskScope = scope.CreateScope($"{TypeMetadataCache<OwinHostScope>.ShortName} - {settings.ToDebugString()}", CloseContext);
            }
Esempio n. 32
0
 public HttpOwinHostContext(HttpHostSettings settings, ITaskSupervisor supervisor)
     : this(settings, supervisor.CreateParticipant($"{TypeMetadataCache<HttpOwinHostContext>.ShortName} - {settings.ToDebugString()}"))
 {
 }
 public static string ToDebugString(this HttpHostSettings settings)
 {
     return($"{settings.Host}:{settings.Port}");
 }
Esempio n. 34
0
        public OwinHostCache(HttpHostSettings settings, ITaskSupervisor supervisor)
        {
            _settings = settings;

            _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<OwinHostCache>.ShortName} - {settings.ToDebugString()}", CloseScope);
        }