Ejemplo n.º 1
0
        // This was built mostly for testing
        public Task Execute(IMessagingAction action)
        {
            if (_hasStarted)
            {
                var wrapper = new MessageActionWrapper(action);
                _worker.Post(wrapper);

                return(wrapper.Completion);
            }
            else
            {
                return(processAction(action));
            }
        }
Ejemplo n.º 2
0
        // This was built mostly for testing
        public Task Execute(IMessagingAction action)
        {
            // this is a side effect of the agent being shut down
            if (action == null)
            {
                return(Task.CompletedTask);
            }

            if (_hasStarted)
            {
                var wrapper = new MessageActionWrapper(action);
                _worker.Post(wrapper);

                return(wrapper.Completion);
            }
            else
            {
                return(processAction(action));
            }
        }