Exemplo n.º 1
0
 /// <summary>
 /// CTOR
 /// Registers the actor into <paramref name="actorSystem"/> using given <paramref name="name"/>
 /// Enables the message processing of the actor and sets the <see cref="ReceiveTarget"/> to <see cref="Receive"/> method
 /// </summary>
 /// <param name="actorSystem">Actor system</param>
 /// <param name="name">Actor name</param>
 protected Actor(IActorSystem actorSystem, string name)
 {
     ActorSystem   = actorSystem;
     ReceiveTarget = Receive;
     Self          = actorSystem.RegisterActor(this, name);
     CanReceive    = true;
 }
Exemplo n.º 2
0
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="actorSystem">Actor system</param>
 /// <param name="responseType">Expected type of the response</param>
 /// <param name="waitHandle">Wait handle used to signal that the response has arrived </param>
 public SyncActor(IActorSystem actorSystem, Type responseType, AutoResetEvent waitHandle)
 {
     ActorSystem   = actorSystem;
     ReceiveTarget = Receive;
     ReceiveTarget = Receive;
     Self          = actorSystem.RegisterActor(this, $"SyncActor{Guid.NewGuid()}");
     CanReceive    = true;
     ResponseType  = responseType;
     WaitHandle    = waitHandle;
 }