Ejemplo n.º 1
0
 internal Fault(ActorSystem system, ActorPath receiver, IActorReference faulted_actor, Exception exception)
 {
     System       = system;
     Receiver     = receiver;
     FaultedActor = faulted_actor;
     Exception    = exception;
 }
Ejemplo n.º 2
0
 public ActorQueueToken(ActorSystem system, ActorPath receiver, Type data_type, object data, IActorReference sender)
 {
     System   = system;
     Receiver = receiver;
     DataType = data_type;
     Data     = data;
     Sender   = sender;
 }
Ejemplo n.º 3
0
        internal void Populate(ActorSystem system, IActorReference parent, ActorPath path)
        {
            Path     = path;
            ActorLog = new ActorLogger(this);
            System   = system;
            Self     = new LocalActorReference(system, path);
            Stash    = new MessageStash(system, this);

            Handlers         = new HandlerService(system, this);
            InternalParent   = parent;
            InternalChildren = new List <IActorReference>();
            InternalLog      = ActorLog;
        }
Ejemplo n.º 4
0
        // NOTICE: we just aren't doing an Ask method
        public Task <Context <R> > Ask <T, R>(T data, IActorReference sender, TimeSpan timeout)
        {
            var token = new CancellationTokenSource();

            // Tell<T>(data, sender);

            // TODO: we need to put the scheduler's container for the sender
            // in some sort of state where it will only accept a message of type
            // R from this actor.
            // No, actually just return R. The problem is how to get it out of this actor reference.

            // TODO: we'll have tell the scheduler this is an Ask message and intercept it when it runs,
            // then instead of Telling the sender normally, the scheduler will just return the message
            // from here as a Task<R>

            // TODO: maybe instead, we'll put the state machine for Ask'ing inside the sender actor itself

            var task = Task <R> .Run <R>(() =>
            {
                // TODO: tell the sender?
                // we might need to run some of the scheduler manually in here
                return(null !);
            }
                                         , token.Token)
                       .ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    // TODO: escelate errors
                }
            });

            token.CancelAfter(timeout);
            // return task;

            throw new NotImplementedException();
        }
Ejemplo n.º 5
0
 public void DestroyActor(IActorReference reference)
 {
     DestroyActor(reference.Path);
 }
Ejemplo n.º 6
0
 public void InformError(IActorReference sender, Exception e)
 {
     // Do nothing.
 }
Ejemplo n.º 7
0
 public void Tell <T>(T data, IActorReference sender)
 {
     // Do nothing.
 }
Ejemplo n.º 8
0
 static ActorReferences()
 {
     Nobody    = new NoActorReference("nobody");
     NoSender  = new NoActorReference("no-sender");
     LostActor = new NoActorReference("lost-actor");
 }
Ejemplo n.º 9
0
 internal Context(IActorReference sender)
 {
     Sender = sender;
 }
Ejemplo n.º 10
0
 public Task <Context <T> > Ask <T>(T data, IActorReference sender)
 {
     return(Ask <T, T>(data, sender, TimeSpan.FromSeconds(5)));
 }
Ejemplo n.º 11
0
 public LostLetter(IActorReference sender, ActorPath receiver, object data)
 {
     Sender   = sender;
     Receiver = receiver;
     Data     = data;
 }
Ejemplo n.º 12
0
 public void InformError(IActorReference sender, Exception e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
 public void Tell <T>(T data, IActorReference sender)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
 public void InformError(IActorReference sender, Exception e)
 {
     System.InformUnhandledError(Path, sender, e);
 }
Ejemplo n.º 15
0
 internal Context()
 {
     Sender = ActorReferences.NoSender;
 }
Ejemplo n.º 16
0
 public StashAtom(IActorReference sender, object message)
 {
     Sender  = sender;
     Message = message;
 }
Ejemplo n.º 17
0
 public void Tell <T>(T data, IActorReference sender)
 {
     System.EnqueueForMessageProcessing <T>(Path, data, sender);
 }