コード例 #1
0
        /// <summary>
        /// Management bus - Send the circuit status change.
        /// </summary>
        /// <param name="circuitName"></param>
        /// <param name="newState"></param>
        public static void ManagementBusCircuitStateChangedNotifier(string circuitName, CircuitState newState)
        {
            if (_managementBusClient == null)
                return;

            var stateChange = new CircuitStatus(_managementBusClient.ClientId, circuitName, newState, DateTimeOffset.Now);

            _managementBusClient.SendMessage(ManagementBus_StateChange_Topic, stateChange);
        }
コード例 #2
0
        /// <summary>
        /// Management bus handler - Get circuit state.
        /// </summary>
        /// <param name="message"></param>
        private static void GetCircuitState(CircuitName message)
        {
            var status = GetState(message.ToString());

            var circuitStatus = new CircuitStatus(_managementBusClient.ClientId, message.ToString(), status, DateTimeOffset.Now);

            _managementBusClient.SendMessage(ManagementBus_StateChange_Topic, circuitStatus);
        }