public void Start()
        {
            ClusterSystem = ActorSystem.Create("sys");
            var router = ClusterSystem.ActorOf(Props.Create(() => new RemoteJobActor()).WithRouter(FromConfig.Instance), "tasker");

            var commandExecutor = ClusterSystem.ActorOf(Props.Create(() => new CommandExecutor(router)), "commands");

            ObjectFactory.Initialize(cfg => cfg.For<IActorRef>().Singleton().Use(commandExecutor).Named("commands"));

            _restServiceHost = new RESTServiceHost();
            _restServiceHost.Init();
            _restServiceHost.Start(REST_SERVICE_URL);
        }
コード例 #2
0
        public void Start()
        {
            ClusterSystem = ActorSystem.Create("sys");
            var router = ClusterSystem.ActorOf(Props.Create(() => new RemoteJobActor()).WithRouter(FromConfig.Instance), "tasker");

            var commandExecutor = ClusterSystem.ActorOf(Props.Create(() => new CommandExecutor(router)), "commands");

            ObjectFactory.Initialize(cfg => cfg.For <IActorRef>().Singleton().Use(commandExecutor).Named("commands"));


            _restServiceHost = new RESTServiceHost();
            _restServiceHost.Init();
            _restServiceHost.Start(REST_SERVICE_URL);
        }