コード例 #1
0
        public void DetectEndpointFromLocalAudit(EndpointDetails newEndpointDetails)
        {
            var endpointInstanceId = newEndpointDetails.ToInstanceId();

            if (endpoints.TryAdd(endpointInstanceId.UniqueId, new EndpointInstanceMonitor(endpointInstanceId, false, domainEvents)))
            {
                domainEvents.Raise(new NewEndpointDetected {
                    DetectedAt = DateTime.UtcNow, Endpoint = newEndpointDetails
                });
            }
        }
コード例 #2
0
        public async Task DetectEndpointFromHeartbeatStartup(EndpointDetails newEndpointDetails, DateTime startedAt)
        {
            var endpointInstanceId = newEndpointDetails.ToInstanceId();

            endpoints.GetOrAdd(endpointInstanceId.UniqueId, id => new EndpointInstanceMonitor(endpointInstanceId, true, domainEvents));

            await domainEvents.Raise(new EndpointStarted
            {
                EndpointDetails = newEndpointDetails,
                StartedAt       = startedAt
            }).ConfigureAwait(false);
        }
コード例 #3
0
        public void DetectEndpointFromHeartbeatStartup(EndpointDetails newEndpointDetails, DateTime startedAt)
        {
            var endpointInstanceId = newEndpointDetails.ToInstanceId();

            endpoints.GetOrAdd(endpointInstanceId.UniqueId, id => new EndpointInstanceMonitor(endpointInstanceId, true, domainEvents));

            domainEvents.Raise(new EndpointStarted
            {
                EndpointDetails = newEndpointDetails,
                StartedAt       = startedAt
            });
        }
コード例 #4
0
        public async Task EndpointDetected(EndpointDetails newEndpointDetails)
        {
            var endpointInstanceId = newEndpointDetails.ToInstanceId();

            if (endpoints.TryAdd(endpointInstanceId.UniqueId, new EndpointInstanceMonitor(endpointInstanceId, false, domainEvents)))
            {
                await domainEvents.Raise(new EndpointDetected
                {
                    DetectedAt = DateTime.UtcNow,
                    Endpoint   = newEndpointDetails
                }).ConfigureAwait(false);
            }
        }
コード例 #5
0
        public void DetectEndpointFromRemoteAudit(EndpointDetails newEndpointDetails)
        {
            var endpointInstanceId = newEndpointDetails.ToInstanceId();

            endpoints.GetOrAdd(endpointInstanceId.UniqueId, id => new EndpointInstanceMonitor(endpointInstanceId, false, domainEvents));
        }