Beispiel #1
0
        public ConnectionStatusIntegrationEventReply GetConnectionStatus(ConnectionStatusIntegrationEvent connectionStatusIntegrationEvent)
        {
            ((IEventBusRpc)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"]).Publish(connectionStatusIntegrationEvent);

            if (((IEventBusRpc)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"]).EventHandler is ConnectionStatusRpcHandler eventHandler)
            {
                return(eventHandler.Take().Result);
            }

            return(new ConnectionStatusIntegrationEventReply());
        }
Beispiel #2
0
        public ConnectionStatusIntegrationEventReply GetConnectionStatus(ConnectionStatusIntegrationEvent connectionStatusIntegrationEvent)
        {
            if (TagGroupEventBus.ContainsKey(connectionStatusIntegrationEvent.GroupName + "_Connection"))
            {
                var result = ((IEventBusRpcClient)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"])
                             .CallAsync <ConnectionStatusIntegrationEventReply>(connectionStatusIntegrationEvent);

                return(result.Result);
            }

            _logger.LogError("GetConnectionStatus: " + connectionStatusIntegrationEvent.GroupName + " " + connectionStatusIntegrationEvent.ConnectionName + " Error!");

            return(new ConnectionStatusIntegrationEventReply());
        }
Beispiel #3
0
        public async ValueTask <ConnectionStatusIntegrationEventReply> GetConnectionStatusAsync(ConnectionStatusIntegrationEvent connectionStatusIntegrationEvent)
        {
            if (TagGroupEventBus.ContainsKey(connectionStatusIntegrationEvent.GroupName + "_Connection"))
            {
                return(await((IEventBusRpcClient)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"])
                       .CallAsync <ConnectionStatusIntegrationEventReply>(connectionStatusIntegrationEvent));
            }

            _logger.LogError("GetConnectionStatus: " + connectionStatusIntegrationEvent.GroupName + " " + connectionStatusIntegrationEvent.ConnectionName + " Error!");

            return(new ConnectionStatusIntegrationEventReply());
        }
Beispiel #4
0
        public async ValueTask <ConnectionStatusIntegrationEventReply> GetConnectionStatusAsync(ConnectionStatusIntegrationEvent connectionStatusIntegrationEvent)
        {
            await((IEventBusRpc)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"])
            .Publish(connectionStatusIntegrationEvent)
            .ConfigureAwait(false);

            if (((IEventBusRpc)TagGroupEventBus[connectionStatusIntegrationEvent.GroupName + "_Connection"]).EventHandler is ConnectionStatusRpcHandler eventHandler)
            {
                return(await eventHandler.Take().ConfigureAwait(false));
            }

            return(new ConnectionStatusIntegrationEventReply());
        }