public MessageContext(IActorProcess actor, IEvent message, ICanPost sender, IActorRegistry actorRegistry)
 {
     Actor    = actor;
     Message  = message;
     Sender   = sender;
     Registry = actorRegistry;
 }
Example #2
0
 public MessageContext(IActorProcess actor, IMessage message, ActorId sender, IActorRegistry actorRegistry)
 {
     Actor    = actor;
     Message  = message;
     Sender   = sender;
     Registry = actorRegistry;
 }
 public ActorProcessConfiguration(ActorId id, Func <IActor> actorFactory, IActorProcess parent, ActorType type)
 {
     Id           = id;
     ActorFactory = actorFactory;
     Parent       = parent;
     Type         = type;
 }
Example #4
0
        public IActorProcess Add(Func <IActor> actorFactory, ActorType type, IActorProcess parent)
        {
            var id            = NextId(string.Empty, type);
            var configuration = new ActorProcessConfiguration(id, actorFactory, parent, type);

            return(AddInternal <IActorProcess>(configuration));
        }
Example #5
0
        public ReaderProvider(IActorProcess sender, IActorRegistry registry, ISerializer serializer)
        {
            _readerCache = new ConcurrentDictionary <ActorId, IReader>();
            _writerCache = new ConcurrentDictionary <ActorId, IWriter>();

            _serializer = serializer;
            _registry   = registry;
            _sender     = sender;
        }
        public RemoteReaderEndpoint(IActorProcess process, ISerializer serializer)
        {
            _server = new Server
            {
                Services = { Reader.BindService(new RemoteReaderService(process, serializer)) },
                Ports    = { new ServerPort(process.Configuration.Uri.Host, process.Configuration.Uri.Port, ServerCredentials.Insecure) }
            };

            _server.Start();
        }
Example #7
0
        public Task HandleFailure(IActorProcess self, Failure failure)
        {
            self.Post(new Restart(self.Configuration.Id.Value, failure.Reason), self);

            foreach (var child in self.Children)
            {
                child.Post(new Restart(child.Configuration.Id.Value, failure.Reason), self);
            }

            return(Task.CompletedTask);
        }
Example #8
0
        public Root(IActorRegistry registry, IRootRemoteConfiguration rootConfiguration)
        {
            _registry = registry;

            if (string.IsNullOrEmpty(rootConfiguration.Adress))
            {
                _process = _registry.Add(rootConfiguration.ActorFactory, null);
            }
            else
            {
                _process = _registry.Add(rootConfiguration.ActorFactory, rootConfiguration.Adress, null);
            }
        }
 public BlockingCollectionMailbox(IActorProcess process, IActorRegistry registry)
 {
     _process  = process;
     _registry = registry;
 }
Example #10
0
 public LocalWriter(IActorRegistry registry, IActorProcess process)
 {
     _registry = registry;
     _process  = process;
 }
Example #11
0
 public RemoteReaderService(IActorProcess self, ISerializer serializer, IActorRegistry registry)
 {
     _serializer = serializer;
     _self       = self;
     _registry   = registry;
 }
Example #12
0
 public CommandHandler(IActorProcess actorProcess, IActorRegistry registry)
 {
     _actorProcess    = actorProcess;
     _registry        = registry;
     _pendingCommands = new Dictionary <Guid, TaskCompletionSource <ICommandResult> >();
 }
 public LocalReader(ActorId actorId, IActorRegistry registry, IActorProcess sender)
 {
     _target = registry.Get(actorId.Value);
     _sender = sender;
 }
Example #14
0
        public void Post(IMessage msg, IActorProcess sender)
        {
            var context = new MessageContext(_process, msg, sender.Configuration.Id, _registry);

            _messages.Add(context);
        }
 public RemoteWriterService(IActorProcess actorProcess, ISerializer serializer)
 {
     _actorProcess = actorProcess;
     _serializer   = serializer;
 }
 public RemoteReaderService(IActorProcess self, ISerializer serializer)
 {
     _serializer = serializer;
     _self       = self;
 }
Example #17
0
 public RemoteReader(IActorProcess actorProcess, ISerializer serializer)
 {
     _reader = new RemoteReaderEndpoint(actorProcess, serializer);
 }
Example #18
0
 public void Post(IMessage msg, IActorProcess sender)
 {
     _mailbox.Post(msg, sender);
 }