// 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)); } }
// 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)); } }