示例#1
0
        public ShellViewModel(HomeViewModel home, SettingsViewModel settings, ConversationsViewModel convos, IActorRefFactory system)
        {
            _screens.Add(Screens.Home, home);
            _screens.Add(Screens.Settings, settings);
            _screens.Add(Screens.Conversations, convos);

            system.ActorSelection(ClientActorPaths.ErrorDialogActor.Path)
                .Tell(new ErrorDialogActor.RegisterShell(this));

            _shellViewModelActor = system.ActorOf(Props.Create(() => new ShellViewModelActor(this)),
                ClientActorPaths.ShellViewModelActor.Name);
        }
 public ProductsActorProvider(IActorRefFactory actorSystem, IProductsService productsService)
 {
     _productsActor = actorSystem.ActorOf(Props.Create <ProductsActor>(productsService), Name);
 }
 public static IActorRef ActorOf <TActor>(this IActorRefFactory factory, string name = null) where TActor : ActorBase, new()
 {
     return(factory.ActorOf(Props.Create <TActor>(), name: name));
 }
示例#4
0
 public CreateModel(IActorRefFactory actorRefFactory, IHostingEnvironment hostingEnvironment)
 {
     _queryRootActor     = actorRefFactory.ActorOf <QueryRootActor>();
     _commandRootActor   = actorRefFactory.ActorOf <CommandRootActor>();
     _hostingEnvironment = hostingEnvironment;
 }
示例#5
0
 public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
 {
     return(actorRefFactory.ActorOf(Props.Create(() =>
                                                 new BotActor(_clusterContext, "bot" + (long)id, (string)args[0], (Type)args[1]))));
 }
 public static Reporter CreateReporter(IActorRefFactory factory, string?name = "Reporter")
 => new Reporter(factory.ActorOf(Props.Create(() => new ReporterActor()).WithSupervisorStrategy(SupervisorStrategy.StoppingStrategy), name));
示例#7
0
        public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
        {
            var param = (CreateGameParam)args[0];

            var gameActor = actorRefFactory.ActorOf(Props.Create(
                () => new GameActor(_clusterContext, (long)id, param)));

            if (param.WithBot)
            {
                actorRefFactory.ActorOf(Props.Create(
                    () => new GameBotActor(_clusterContext, gameActor.Cast<GameRef>(), 0, "bot")));
            }

            return gameActor;
        }
示例#8
0
 public CreateModel(IActorRefFactory actorRefFactory)
 {
     _commandRootActor = actorRefFactory.ActorOf <CommandRootActor>();
 }
示例#9
0
 public static RepositoryManager CreateInstance(IActorRefFactory factory, string connectionString, DataTransferManager tranferManager)
 => new RepositoryManager(factory.ActorOf(Props.Create(() => new RepositoryManagerImpl(new MongoClient(connectionString), tranferManager))));
示例#10
0
 public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
 {
     return actorRefFactory.ActorOf(Props.Create(() => new UserActor(_clusterContext, (long)id)));
 }
示例#11
0
        public SettingsViewModel(IActorRefFactory system)
        {
            DisplayName = "Settings";

            _vmActor = system.ActorOf(Props.Create(() => new SettingsViewModelActor(this)), ClientActorPaths.SettingsViewModelActor.Name);
        }
示例#12
0
 public static TypedActorReference <TMessage> ActorOf <TMessage>(this IActorRefFactory actorReferenceFactory, Props <TMessage> props, string name) =>
 new TypedActorReference <TMessage>(actorReferenceFactory.ActorOf(props.Underlying, name));
示例#13
0
 public CustomerActorProvider(IActorRefFactory actorSystem, ICustomerRepository repo)
 {
     CustomersActor = actorSystem.ActorOf(Props.Create <CustomersActor>(repo), "customers");
 }
示例#14
0
 public AkkaViewModel(IActorRefFactory actorSystem, IActorRef targetActor) : this()
 {
     Actor = actorSystem.ActorOf(AkkaModelViewActor.Props(this, targetActor));
 }
示例#15
0
 public WeatherService(IActorRefFactory actorSystem, IdentifierGenerator identifierGenerator)
 {
     _weatherManager      = actorSystem.ActorOf(WeatherManager.Props());
     _identifierGenerator = identifierGenerator;
 }
示例#16
0
 public ConstructionSystem(EntityManager entityManager, IActorRefFactory actorRefFactory) : base(entityManager)
 {
     Actor = actorRefFactory.ActorOf(SystemActor.Props(this), "ConstructionSystem");
 }
 public BasketManagerActorProvider(IActorRefFactory system, ProductActorProvider productActorProvider)
 {
     _basketManagerRef = system.ActorOf(BasketManagerActor.Props(productActorProvider.Get()), "basket-manager");
 }
示例#18
0
 public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
 {
     return(actorRefFactory.ActorOf(Props.Create(() => new UserActor(_clusterContext, (string)id, (IUserEventObserver)args[0]))));
 }
示例#19
0
 public static DeploymentManager CreateInstance(IActorRefFactory factory, string connectionString, DataTransferManager manager, RepositoryApi api)
 => new DeploymentManager(factory.ActorOf(Props.Create(() => new DeploymentServerImpl(new MongoClient(connectionString), manager, api)), DeploymentApi.DeploymentPath));
 public Maybe <IActorRef> Init(IActorRefFactory superviser, Maybe <TWorkspace> workspace)
 {
     Workspace = workspace;
     return(superviser.ActorOf(() => new InternalRuleActor(ActorConstruct), Name));
 }
 public static TypedActorRef InterfacedActorOf(this IActorRefFactory factory, Props props, string name = null)
 {
     return(new TypedActorRef {
         Actor = factory.ActorOf(props, name), Type = props.Type
     });
 }
 public static IActorRef CreateListner(IActorRefFactory factory, Action <string> listner, Action <IOperationResult> onCompled, TimeSpan timeout, string?name = "LogListner")
 => factory.ActorOf(Props.Create(() => new Listner(listner, onCompled, timeout)).WithSupervisorStrategy(SupervisorStrategy.StoppingStrategy), name);
示例#23
0
 public Task <Written> WriteEvents(long from, IImmutableList <IPersistentRepresentation> events) => factory
 .ActorOf(Props.Create(() => new EventWriterActor(persistenceId, journalRef)))
 .Ask <Written>(new Write(events.ToImmutableList(), from), Timeout);
 public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
 {
     return(actorRefFactory.ActorOf(Props.Create(() => new UserActor(_clusterContext, (long)id))));
 }
示例#25
0
 public Task <Replayed> ReplayEvents(long from, long max) => factory
 .ActorOf(Props.Create(() => new EventReplayerActor(persistenceId, journalRef)))
 .Ask <Replayed>(new Replay(from, max), Timeout);
 public ProductActorProvider(IActorRefFactory system, IProductsDataSource productsDataSource)
 {
     _productActorRef = system.ActorOf(ProductActor.Props(productsDataSource), "products");
 }
示例#27
0
 public IndexModel(IActorRefFactory actorRefFactory)
 {
     _queryRootActor = actorRefFactory.ActorOf <QueryRootActor>();
 }
示例#28
0
文件: Act.cs 项目: yfer/akka.net
 public static IActorRef ActorOf(this IActorRefFactory factory, Action <IActorDsl, IActorContext> config, string name = null)
 {
     return(factory.ActorOf(Props.Create(() => new Act(config)), name));
 }
 public static IActorRef CategoryQueryAggregate(this IActorRefFactory system)
 {
     return(system.ActorOf(Props.Create <CategoryQueryActor>(), SystemData.CategoryQueryActor.Name));
 }
示例#30
0
 public AkkaViewModel(IActorRefFactory actorSystem) : this()
 {
     Actor = actorSystem.ActorOf(AkkaModelViewActor.Props(this));
 }
 public static IActorRef ActorOf <TActor>(this IActorRefFactory fac, Expression <Func <TActor> > creator,
                                          string?name = null) where TActor : ActorBase => fac.ActorOf(Props.Create(creator), name);
示例#32
0
 public IActorRef CreateActor(IActorRefFactory actorRefFactory, object id, object[] args)
 => actorRefFactory.ActorOf(Props.Create <TActor>(args), id.ToString());
示例#33
0
 public static IActorRef RunAsUnsupervisedActor <T>(this Action <T> action, IActorRefFactory actorRefFactory)
 {
     return(actorRefFactory.ActorOf(Props.Create(() => new FunctorActor <T>(action))));
 }
示例#34
0
        public HomeViewModel(IActorRefFactory system)
        {
            DisplayName = "Home screen";

            _homeViewModelActor = system.ActorOf(Props.Create(() => new HomeViewModelActor(this)), ClientActorPaths.HomeViewModelActor.Name);
        }
示例#35
0
 public EmployeeActorProvider(IActorRefFactory actorSystem, ICustomerRepository repo)
 {
     EmployeeActor = actorSystem.ActorOf(Props.Create <CustomersActor>(repo), "employees");
 }