Beispiel #1
0
 private void SendUserMessage(PID target, object message)
 {
     if (_props.SenderMiddlewareChain != null)
     {
         //slow path
         _props.SenderMiddlewareChain(EnsureExtras().Context, target, MessageEnvelope.Wrap(message));
     }
     else
     {
         //fast path, 0 alloc
         target.SendUserMessage(message);
     }
 }
Beispiel #2
0
 private void SendUserMessage(PID target, object message)
 {
     if (SenderMiddleware != null)
     {
         if (message is MessageEnvelope messageEnvelope)
         {
             //Request based middleware
             SenderMiddleware(this, target, messageEnvelope);
         }
         else
         {
             //tell based middleware
             SenderMiddleware(this, target, new MessageEnvelope(message, null, null));
         }
         return;
     }
     //Default path
     target.SendUserMessage(message);
 }
 public static void Tell(this PID self, object message)
 {
     self.SendUserMessage(message);
 }
Beispiel #4
0
 internal static Task Sender(ISenderContext context, PID target, MessageEnvelope envelope)
 {
     target.SendUserMessage(envelope);
     return(Actor.Done);
 }
Beispiel #5
0
 private Task DefaultSender(ISenderContext context, PID target, MessageEnvelope message)
 {
     target.SendUserMessage(message);
     return(Actor.Done);
 }
Beispiel #6
0
 internal static Task Sender(ISenderContext context, PID target, MessageEnvelope envelope)
 {
     target.SendUserMessage(context.System, envelope);
     return(Task.CompletedTask);
 }