コード例 #1
0
        public ReceiveEndpointClientFactoryContext(ReceiveEndpointReady receiveEndpointReady, RequestTimeout defaultTimeout = default)
        {
            _receiveEndpoint = receiveEndpointReady.ReceiveEndpoint;

            ResponseAddress = receiveEndpointReady.InputAddress;
            DefaultTimeout  = defaultTimeout.Or(RequestTimeout.Default);
        }
コード例 #2
0
                Task IReceiveEndpointObserver.Ready(ReceiveEndpointReady ready)
                {
                    _handle.Disconnect();
                    _registration.Dispose();

                    return(_ready.TrySetResultOnThreadPool(ready));
                }
コード例 #3
0
            public Task Ready(ReceiveEndpointReady ready)
            {
                _serviceEndpoint.Started = DateTime.UtcNow;
                _serviceEndpoint.DisconnectConfigurationObservers();

                return(_serviceEndpoint.NotifyUp());
            }
コード例 #4
0
        /// <summary>
        /// Connects a client factory to a host receive endpoint, using the bus as the send endpoint provider
        /// </summary>
        /// <param name="receiveEndpointHandle">A handle to the receive endpoint, which is stopped when the client factory is disposed</param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public static async Task <IClientFactory> CreateClientFactory(this HostReceiveEndpointHandle receiveEndpointHandle, RequestTimeout timeout = default)
        {
            ReceiveEndpointReady ready = await receiveEndpointHandle.Ready.ConfigureAwait(false);

            var context = new HostReceiveEndpointClientFactoryContext(receiveEndpointHandle, ready, timeout);

            return(new ClientFactory(context));
        }
コード例 #5
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            LogContext.Debug?.Log("Endpoint Ready: {InputAddress}", ready.InputAddress);

            ready.ReceiveEndpoint.ConnectPublishObserver(_publishObserver);

            return(TaskUtil.Completed);
        }
コード例 #6
0
                Task IReceiveEndpointObserver.Ready(ReceiveEndpointReady ready)
                {
                    _ready.TrySetResult(ready);

                    _handle.Disconnect();

                    return(TaskUtil.Completed);
                }
コード例 #7
0
            public Task SetReady(ReceiveEndpointReady ready)
            {
                _handle.Disconnect();
                _registration.Dispose();

                _ready.TrySetResult(ready);

                return(Util.TaskUtil.Completed);
            }
コード例 #8
0
            public Task Ready(ReceiveEndpointReady ready)
            {
                _serviceEndpoint.Started = DateTime.UtcNow;
                _serviceEndpoint.DisconnectObservers();

                Task.Run(() => _serviceEndpoint.NotifyUp());

                return(TaskUtil.Completed);
            }
コード例 #9
0
            public Task Ready(ReceiveEndpointReady ready)
            {
                if (ready.InputAddress == _harness.InputQueueAddress)
                {
                    _receiveEndpoint = ready.ReceiveEndpoint;
                }

                return(Task.CompletedTask);
            }
コード例 #10
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            if (_log.IsDebugEnabled)
            {
                _log.Debug($"Endpoint Ready: {ready.InputAddress}");
            }

            ready.ReceiveEndpoint.ConnectPublishObserver(_publishObserver);

            return(TaskUtil.Completed);
        }
コード例 #11
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            lock (_killSwitches)
            {
                if (!_killSwitches.TryGetValue(ready.InputAddress, out var killSwitch))
                {
                    killSwitch = new KillSwitch(_options, ready.ReceiveEndpoint);

                    _killSwitches.Add(ready.InputAddress, killSwitch);

                    ready.ReceiveEndpoint.ConnectConsumeObserver(killSwitch);
                }
            }

            return(Task.CompletedTask);
        }
コード例 #12
0
 public HostReadyEvent(Uri hostAddress, ReceiveEndpointReady[] receiveEndpoints)
 {
     HostAddress = hostAddress;
     ReceiveEndpoints = receiveEndpoints;
 }
コード例 #13
0
                Task IReceiveEndpointObserver.Ready(ReceiveEndpointReady ready)
                {
                    _handle.Disconnect();

                    return(Task.Factory.StartNew(() => _ready.TrySetResult(ready), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default));
                }
コード例 #14
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     GetEndpoint(ready.InputAddress).Ready = true;
     return(Health.Done);
 }
コード例 #15
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            PrometheusMetrics.EndpointReady(ready);

            return(Task.CompletedTask);
        }
コード例 #16
0
 public HostReceiveEndpointClientFactoryContext(HostReceiveEndpointHandle receiveEndpointHandle, ReceiveEndpointReady receiveEndpointReady,
                                                RequestTimeout defaultTimeout = default)
     : base(receiveEndpointReady, defaultTimeout)
 {
     _receiveEndpointHandle = receiveEndpointHandle;
 }
コード例 #17
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return(Console.Out.WriteLineAsync($"Endpoint Ready: {ready.InputAddress}"));
 }
コード例 #18
0
 Task IReceiveEndpointObserver.Ready(ReceiveEndpointReady ready)
 {
     return(_handles.ForEachAsync(x => x.SetReady(ready)));
 }
コード例 #19
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return(ForEachAsync(x => x.Ready(ready)));
 }
コード例 #20
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return(_endpointHealth.Ready(ready));
 }
コード例 #21
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return Console.Out.WriteLineAsync($"Endpoint Ready: {ready.InputAddress}");
 }
コード例 #22
0
            public Task Ready(ReceiveEndpointReady ready)
            {
                _receiveEndpoint.TrySetResult(ready.ReceiveEndpoint);

                return(TaskUtil.Completed);
            }
コード例 #23
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return(_machine.RaiseEvent(_endpoint, x => x.ReceiveEndpointReady, ready));
 }
コード例 #24
0
        /// <summary>
        /// Connects a client factory to a host receive endpoint, using the bus as the send endpoint provider
        /// </summary>
        /// <param name="receiveEndpoint"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public static IClientFactory CreateClientFactory(this ReceiveEndpointReady receiveEndpoint, RequestTimeout timeout = default)
        {
            var context = new ReceiveEndpointClientFactoryContext(receiveEndpoint, timeout);

            return(new ClientFactory(context));
        }
コード例 #25
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     _logger.LogDebug("Endpoint is ready to use: {@endpoint}", ready.ReceiveEndpoint);
     return(Task.CompletedTask);
 }
コード例 #26
0
 public void OnReady(ReceiveEndpointReady ready)
 {
     Ready   = true;
     Message = ready.IsStarted ? "ready" : "ready (not started)";
 }
コード例 #27
0
        public static void EndpointReady(ReceiveEndpointReady ready)
        {
            var endpointLabel = GetEndpointLabel(ready.InputAddress);

            _endpointInstances.WithLabels(_serviceLabel, endpointLabel).Inc();
        }
コード例 #28
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            GetEndpoint(ready.InputAddress).Ready = true;

            return(TaskUtil.Completed);
        }
コード例 #29
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            ready.ReceiveEndpoint.ConnectPublishObserver(_publishObserver);

            return(TaskUtil.Completed);
        }
コード例 #30
0
        public Task Ready(ReceiveEndpointReady ready)
        {
            GetEndpoint(ready);

            return(TaskUtil.Completed);
        }
コード例 #31
0
 public Task Ready(ReceiveEndpointReady ready)
 {
     return(_serviceEndpoint.NotifyEndpointReady(ready.ReceiveEndpoint));
 }