Beispiel #1
0
        private Maybe <Task> Handle(HandleCommand hc)
        {
            if (hc.Command.Message is RunScript script)
            {
                return(Handle(script, hc.Context));
            }

            return(None <Task> .Value);
        }
Beispiel #2
0
        private Maybe <Task> Receive(HandleCommand m)
        {
            Command command = m.Command;

            if (m.Command.Target != null)
            {
                if (_registeredMessages.TryGetValue(command.Message.GetType(), out StaticHandlerMethodInvoker? staticHandler))
                {
                    return(Dispatch(command.Message, command.Target !, staticHandler, m.Context));
                }
            }
            return(None <Task> .Value);
        }