Exemple #1
0
        public static Actor Of(Func <IMailBox, Actor> actorBuilder, MailboxMonitor mailboxMonitor)
        {
            var queuedActor   = new QueuedActor();
            var internalActor = actorBuilder(new DelegatingMailBox(() => queuedActor.MailBox));

            queuedActor._actor = internalActor;
            queuedActor.Id     = internalActor.Id;
            mailboxMonitor.MonitorActor(queuedActor);

            queuedActor.Start();
            return(queuedActor);
        }
Exemple #2
0
 public ActorsSystem(IScheduler scheduler = null)
 {
     _actors   = new List <Actor>();
     Monitor   = new MailboxMonitor();
     Scheduler = scheduler ?? new Scheduler(this);
 }