Exemplo n.º 1
0
 public HttpHostConfiguration(IHttpBusConfiguration busConfiguration, IHttpTopologyConfiguration topologyConfiguration)
     : base(busConfiguration)
 {
     _busConfiguration      = busConfiguration;
     _hostSettings          = new ConfigurationHostSettings();
     _topologyConfiguration = topologyConfiguration;
 }
Exemplo n.º 2
0
 public HttpConsumerFilter(HttpHostSettings hostSettings, ReceiveSettings receiveSettings,
                           HttpReceiveEndpointContext context)
 {
     _hostSettings    = hostSettings;
     _receiveSettings = receiveSettings;
     _context         = context;
 }
Exemplo n.º 3
0
        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);
        }
Exemplo 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);
        }
Exemplo n.º 8
0
        public HttpHostConfiguration(IHttpBusConfiguration busConfiguration, HttpHostSettings settings, IHostTopology hostTopology)
        {
            _busConfiguration = busConfiguration;
            _settings         = settings;
            _hostTopology     = hostTopology;

            HostAddress = settings.GetInputAddress();

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

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

            SetReady();
        }
Exemplo 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);
        }
Exemplo 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;
 }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo n.º 20
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();
        }
Exemplo 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();
        }
Exemplo n.º 22
0
        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();
        }
Exemplo n.º 23
0
 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);
        }
Exemplo 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;
 }
Exemplo n.º 28
0
 public HttpHostCache(HttpHostSettings settings)
     : base(new HttpHostContextFactory(settings))
 {
 }
Exemplo n.º 29
0
 public HttpHostContextFactory(HttpHostSettings settings)
 {
     _settings = settings;
 }
Exemplo n.º 30
0
        public OwinHostCache(HttpHostSettings settings, ITaskSupervisor supervisor)
        {
            _settings = settings;

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

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

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