Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }