当前位置: 首页>>代码示例>>C#>>正文


C# Props类代码示例

本文整理汇总了C#中Props的典型用法代码示例。如果您正苦于以下问题:C# Props类的具体用法?C# Props怎么用?C# Props使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Props类属于命名空间,在下文中一共展示了Props类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMailboxType

        public Type GetMailboxType(Props props, Config dispatcherConfig)
        {
            if (!string.IsNullOrEmpty(props.Mailbox))
            {
                return FromConfig(props.Mailbox);
            }

            var actortype = props.Type;
            var interfaces = actortype.GetInterfaces()
                .Where(i => i.IsGenericType)
                .Where(i => i.GetGenericTypeDefinition() == typeof (RequiresMessageQueue<>))
                .Select(i => i.GetGenericArguments().First())
                .ToList();

            if (interfaces.Count > 0)
            {
                var config = _requirementsMapping[interfaces.First()];
                var mailbox = config.GetString("mailbox-type");
                var mailboxType = Type.GetType(mailbox);
                return mailboxType;
            }


            return FromConfig(DefaultMailboxId);
        }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:25,代码来源:Mailboxes.cs

示例2: RoutedActorCell

        public RoutedActorCell(ActorSystem system, InternalActorRef supervisor, Props routerProps, Props routeeProps, ActorPath path,
            Mailbox mailbox)
            : base(system, supervisor, routerProps, path, mailbox)
        {
            RouteeProps = routeeProps;
            routerConfig = routerProps.RouterConfig;
            Router = routerConfig.CreateRouter(system);
            routerConfig.Match()
                .With<Pool>(r =>
                {
                    var routees = new List<Routee>();
                    for (int i = 0; i < r.NrOfInstances; i++)
                    {
                        var routee = this.ActorOf(RouteeProps);
                        routees.Add(new ActorRefRoutee(routee));
                    }
                    AddRoutees(routees.ToArray());
                })
                .With<Group>(r =>
                {
                    var routees = routerConfig.GetRoutees(this).ToArray();
                    AddRoutees(routees);
                });



            Self = new RoutedActorRef(path, this);
        }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:28,代码来源:RoutedActorCell.cs

示例3: RootGuardianActorRef

 public RootGuardianActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, //TODO: switch from  Func<Mailbox> createMailbox to MailboxType mailboxType
     IInternalActorRef supervisor, ActorPath path, IInternalActorRef deadLetters, IReadOnlyDictionary<string, IInternalActorRef> extraNames)
     : base(system,props,dispatcher,createMailbox,supervisor,path)
 {
     _deadLetters = deadLetters;
     _extraNames = extraNames;
 }
开发者ID:yaozd,项目名称:akka.net,代码行数:7,代码来源:RootGuardianActorRef.cs

示例4: DaemonMsgCreate

 /// <summary>
 ///     Initializes a new instance of the <see cref="DaemonMsgCreate" /> class.
 /// </summary>
 /// <param name="props">The props.</param>
 /// <param name="deploy">The deploy.</param>
 /// <param name="path">The path.</param>
 /// <param name="supervisor">The supervisor.</param>
 public DaemonMsgCreate(Props props, Deploy deploy, string path, IActorRef supervisor)
 {
     Props = props;
     Deploy = deploy;
     Path = path;
     Supervisor = supervisor;
 }
开发者ID:njimenez,项目名称:akka.net,代码行数:14,代码来源:RemoteSystemDaemon.cs

示例5: ActorCell

 public ActorCell(ActorSystemImpl system, InternalActorRef self, Props props, MessageDispatcher dispatcher, InternalActorRef parent)
 {
     _self = self;
     _props = props;
     _systemImpl = system;
     Parent = parent;
     Dispatcher = dispatcher;            
 }
开发者ID:ClusterReply,项目名称:akka.net,代码行数:8,代码来源:ActorCell.cs

示例6: PlayerActor

 public PlayerActor(string name, Props propsForUserInteracting, IActorRef reader)
 {
     _reader = reader;
     _name = name;
     _playerUserInterface = Context.ActorOf(propsForUserInteracting, "ui");
     _reader.Tell(_playerUserInterface);
     Become(Unregistered);
 }
开发者ID:tpaananen,项目名称:AkkaBattleShip,代码行数:8,代码来源:PlayerActor.cs

示例7: Setup

 public void Setup(BenchmarkContext context)
 {
     _selectionOpCounter = context.GetCounter(ActorSelectionCounterName);
     System = ActorSystem.Create("MailboxThroughputSpecBase" + Counter.GetAndIncrement());
     _receiver = System.ActorOf(Props.Create(() => new BenchmarkActor(_selectionOpCounter, NumberOfMessages, _resetEvent)));
     _receiverActorPath = _receiver.Path;
     _oneMessageBenchmarkProps = Props.Create(() => new BenchmarkActor(_selectionOpCounter, 1, _resetEvent));
 }
开发者ID:juergenhoetzel,项目名称:akka.net,代码行数:8,代码来源:ActorSelectionSpecs.cs

示例8: IndexedProjectionStreamReader

        public IndexedProjectionStreamReader(IEventStoreReader reader, PersistedEventFactory factory)
        {
            Argument.Requires(reader != null, nameof(reader));
            Argument.Requires(factory != null, nameof(factory));

            _workerProps = Props.Create<ReadIndexedProjectionStreamWorker>(reader, factory);
            Receive<ReadIndexedProjectionStreamRequest>(r => HandleRequest(r));
        }
开发者ID:promontis,项目名称:Even,代码行数:8,代码来源:IndexedProjectionStreamReader.cs

示例9: RepointableActorRef

 public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path)
 {
     _system = system;
     _props = props;
     _dispatcher = dispatcher;
     _createMailbox = createMailbox;
     _supervisor = supervisor;
     _path = path;
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:9,代码来源:RepointableActorRef.cs

示例10: CreateProps

        public static Props CreateProps(ProjectionStreamQuery query, IActorRef reader, IActorRef writer, GlobalOptions options, Props replayWorkerProps = null)
        {
            Argument.RequiresNotNull(query, nameof(query));
            Argument.RequiresNotNull(reader, nameof(reader));
            Argument.RequiresNotNull(writer, nameof(writer));
            Argument.RequiresNotNull(options, nameof(options));

            return Props.Create<ProjectionStream>(query, reader, writer, options, replayWorkerProps);
        }
开发者ID:mwatts,项目名称:Even,代码行数:9,代码来源:ProjectionStream.cs

示例11: RepointableActorRef

 public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, IInternalActorRef supervisor, ActorPath path)
 {
     System = system;
     Props = props;
     Dispatcher = dispatcher;
     MailboxType = mailboxType;
     Supervisor = supervisor;
     _path = path;
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:RepointableActorRef.cs

示例12: ConsoleGuardianActor

        public ConsoleGuardianActor()
        {
            _reader = Context.ActorOf(Props.Create(() => new ConsoleReaderActor()), "reader");
            _consoleUi = Props.Create(() => new ConsoleActor());

            Receive<Message.CreatePlayer>(message =>
            {
                Context.ActorOf(Props.Create(() => new PlayerActor(message.Name, _consoleUi, _reader)), (++_counter).ToString());
            });
        }
开发者ID:tpaananen,项目名称:AkkaBattleShip,代码行数:10,代码来源:ConsoleGuardianActor.cs

示例13: EventStoreReader

        public EventStoreReader(IEventStore store, IPersistedEventFactory factory, GlobalOptions options)
        {
            _readProps = ReadWorker.CreateProps(store, factory);
            _readStreamProps = ReadStreamWorker.CreateProps(store, factory);
            _readIndexedProjectionProps = ReadIndexedProjectionStreamWorker.CreateProps(store, factory);
            _readProjectionCheckpointProps = ReadProjectionCheckpointWorker.CreateProps(store);
            _readHighestGlobalSequenceProps = ReadHighestGlobalSequenceWorker.CreateProps(store);

            Ready();
        }
开发者ID:promontis,项目名称:Even,代码行数:10,代码来源:EventStoreReader.cs

示例14: LocalActorRef

 /// <summary>
 /// Inheritors should only call this constructor
 /// </summary>
 internal protected  LocalActorRef(ActorSystem system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path, Func<LocalActorRef, ActorCell> createActorCell) //TODO: switch from  Func<Mailbox> createMailbox to MailboxType mailboxType      
 {
     _system = system;
     _props = props;
     _dispatcher = dispatcher;
     _createMailbox = createMailbox;
     _supervisor = supervisor;
     _path = path;
     _cell = createActorCell(this);
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:13,代码来源:LocalActorRef.cs

示例15: createAgent

 public virtual AgentControllerInterface createAgent(object agentInfo)
 {
     if (agentInfo is Props)
     {
         return this.createAgent((Props) agentInfo);
     }
     Props agentProps = new Props();
     agentProps.setProperty("classname", agentInfo.ToString());
     return this.createAgent(agentProps);
 }
开发者ID:urmilaNominate,项目名称:mERP-framework,代码行数:10,代码来源:Neokernel.cs


注:本文中的Props类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。