internal static RemoteMessageDTO Create(object message, ProcessId to, ProcessId sender, Message.Type type, Message.TagSpec tag, Option<SessionId> sessionId) =>
     map(message as ActorRequest, req =>
         req == null
             ? map(message as ActorResponse, res =>
                 res == null
                     ? CreateMessage(message, to, sender, type, tag, sessionId)
                     : CreateResponse(res, to, sender, sessionId))
             : CreateRequest(req, to, sender, sessionId));
Esempio n. 2
0
 internal static RemoteMessageDTO CreateMessage(object message, ProcessId to, ProcessId sender, Message.Type type, Message.TagSpec tag) =>
     new RemoteMessageDTO
     {
         Type        = (int)type,
         Tag         = (int)tag,
         To          = to.Path,
         RequestId   = -1,
         MessageId   = Guid.NewGuid(),
         Sender      = sender.ToString(),
         ReplyTo     = sender.ToString(),
         ContentType = message == null
                         ? null
                         : message.GetType().AssemblyQualifiedName,
         Content     = message == null
                         ? null
                         : JsonConvert.SerializeObject(message, ActorSystemConfig.Default.JsonSerializerSettings)
     };