• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IInternalActorRef类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: Message

 public Message(IInternalActorRef recipient, Address recipientAddress, SerializedMessage serializedMessage, IActorRef senderOptional = null, SeqNo seq = null)
 {
     Seq = seq;
     SenderOptional = senderOptional;
     SerializedMessage = serializedMessage;
     RecipientAddress = recipientAddress;
     Recipient = recipient;
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:8,代码来源:AkkaPduCodec.cs


示例3: 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


示例4: ActorCell

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


示例5: 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


示例6: 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


示例7: RemoteActorRef

 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteActorRef"/> class.
 /// </summary>
 /// <param name="remote">The remote.</param>
 /// <param name="localAddressToUse">The local address to use.</param>
 /// <param name="path">The path.</param>
 /// <param name="parent">The parent.</param>
 /// <param name="props">The props.</param>
 /// <param name="deploy">The deploy.</param>
 internal RemoteActorRef(RemoteTransport remote, Address localAddressToUse, ActorPath path, IInternalActorRef parent,
     Props props, Deploy deploy)
 {
     Remote = remote;
     LocalAddressToUse = localAddressToUse;
     _path = path;
     _parent = parent;
     _props = props;
     _deploy = deploy;
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:19,代码来源:RemoteActorRef.cs


示例8: ResizablePoolCell

        public ResizablePoolCell(ActorSystemImpl system, IInternalActorRef self, Props routerProps, MessageDispatcher dispatcher, Props routeeProps, IInternalActorRef supervisor, Pool pool)
            : base(system,self, routerProps,dispatcher, routeeProps, supervisor)
        {
            if (pool.Resizer == null) throw new ArgumentException("RouterConfig must be a Pool with defined resizer");

            resizer = pool.Resizer;
            _routerProps = routerProps;
            _pool = pool;
            _resizeCounter = new AtomicCounterLong(0);
            _resizeInProgress = new AtomicBoolean();
        }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:11,代码来源:ResizablePoolCell.cs


示例9: RoutedActorCell

 public RoutedActorCell(
     ActorSystemImpl system,
     IInternalActorRef self,
     Props routerProps,
     MessageDispatcher dispatcher,
     Props routeeProps,
     IInternalActorRef supervisor)
     : base(system, self, routerProps, dispatcher, supervisor)
 {
     RouteeProps = routeeProps;
     RouterConfig = routerProps.RouterConfig;
     Router = null;
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:13,代码来源:RoutedActorCell.cs


示例10: RoutedActorRef

 public RoutedActorRef(
     ActorSystemImpl system,
     Props routerProps,
     MessageDispatcher routerDispatcher,
     MailboxType routerMailbox,
     Props routeeProps,
     IInternalActorRef supervisor,
     ActorPath path)
     : base(system, routerProps, routerDispatcher, routerMailbox, supervisor, path)
 {
     _routeeProps = routeeProps;
     routerProps.RouterConfig.VerifyConfig(path);
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:13,代码来源:RoutedActorRef.cs


示例11: LocalActorRef

        //This mimics what's done in Akka`s construction of an LocalActorRef.
        //The actorCell is created in the overridable newActorCell() during creation of the instance.
        //Since we don't want calls to virtual members in C# we must supply it. 
        //
        //This is the code from Akka:
        //    private[akka] class LocalActorRef private[akka] (
        //        _system: ActorSystemImpl,
        //        _props: Props,
        //        _dispatcher: MessageDispatcher,
        //        _mailboxType: MailboxType,
        //        _supervisor: InternalActorRef,
        //        override val path: ActorPath) extends ActorRefWithCell with LocalRef {
        //      private val actorCell: ActorCell = newActorCell(_system, this, _props, _dispatcher, _supervisor)
        //      actorCell.init(sendSupervise = true, _mailboxType)
        //      ...
        //    }
        public LocalActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, IInternalActorRef supervisor, ActorPath path) 
        {
            _system = system;
            _props = props;
            _dispatcher = dispatcher;
            MailboxType = mailboxType;
            _supervisor = supervisor;
            _path = path;

           /*
            * Safe publication of this class’s fields is guaranteed by Mailbox.SetActor()
            * which is called indirectly from ActorCell.init() (if you’re wondering why
            * this is at all important, remember that under the CLR readonly fields are only
            * frozen at the _end_ of the constructor, but we are publishing “this” before
            * that is reached).
            * This means that the result of NewActorCell needs to be written to the field
            * _cell before we call init and start, since we can start using "this"
            * object from another thread as soon as we run init.
            */
            // ReSharper disable once VirtualMemberCallInContructor 
            _cell = NewActorCell(_system, this, _props, _dispatcher, _supervisor); // _cell needs to be assigned before Init is called. 
            _cell.Init(true, MailboxType);
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:39,代码来源:LocalActorRef.cs


示例12: SendTerminated

 private void SendTerminated(bool ifLocal, IInternalActorRef watcher)
 {
     if (((IActorRefScope)watcher).IsLocal == ifLocal && !watcher.Equals(Parent))
     {
         watcher.SendSystemMessage(new DeathWatchNotification(Self, true, false));
     }
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:7,代码来源:ActorCell.DeathWatch.cs


示例13: ChildRestartStats

 public ChildRestartStats(IInternalActorRef child, uint maxNrOfRetriesCount = 0, long restartTimeWindowStartTicks = 0)
 {
     _child = child;
     _maxNrOfRetriesCount = maxNrOfRetriesCount;
     _restartTimeWindowStartTicks = restartTimeWindowStartTicks;
 }
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:6,代码来源:ChildStats.cs


示例14: TestActorCell

 public TestActorCell(ActorSystemImpl system, IInternalActorRef self, Props props, MessageDispatcher dispatcher, IInternalActorRef parent)
     : base(system, self, props, dispatcher, parent)
 {
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:4,代码来源:InternalTestActorRef.cs


示例15: SetTempContainer

 public void SetTempContainer(IInternalActorRef tempContainer)
 {
     _tempContainer = tempContainer;
 }
开发者ID:yaozd,项目名称:akka.net,代码行数:4,代码来源:RootGuardianActorRef.cs


示例16: InternalTestActorRef

 private InternalTestActorRef(ActorSystem system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path) //TODO: switch from  Func<Mailbox> createMailbox to MailboxType mailboxType      
     : base(system, props, dispatcher, createMailbox, supervisor, path, actorRef => NewActorCell(system, actorRef, props, dispatcher, supervisor, createMailbox))
 {
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:4,代码来源:InternalTestActorRef.cs


示例17: SystemGuardianTests

 public SystemGuardianTests()
 {
     _userGuardian = Sys.ActorOf(Props.Create<GuardianActor>()).AsInstanceOf<IInternalActorRef>();
     _systemGuardian = Sys.ActorOf(Props.Create(() => new SystemGuardianActor(_userGuardian))).AsInstanceOf<IInternalActorRef>();
     _systemGuardian.Tell(new Watch(_userGuardian, _systemGuardian));            
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:6,代码来源:SystemGuardianTests.cs


示例18: NewActorCell

 protected static ActorCell NewActorCell(ActorSystem system, LocalActorRef actorRef, Props props, MessageDispatcher dispatcher, IInternalActorRef supervisor, Func<Mailbox> createMailbox)
 {
     var cell = new TestActorCell((ActorSystemImpl)system, actorRef, props, dispatcher, supervisor);
     cell.Init(sendSupervise: true, createMailbox: createMailbox);
     return cell;
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:6,代码来源:InternalTestActorRef.cs


示例19: ActorOf

        public IInternalActorRef ActorOf(ActorSystemImpl system, Props props, IInternalActorRef supervisor, ActorPath path, bool systemService, Deploy deploy, bool lookupDeploy, bool async)
        {
            if (props.Deploy.RouterConfig.NoRouter())
            {
                if (Settings.DebugRouterMisconfiguration)
                {
                    var d = Deployer.Lookup(path);
                    if (d != null && d.RouterConfig != RouterConfig.NoRouter)
                        Log.Warning("Configuration says that [{0}] should be a router, but code disagrees. Remove the config or add a RouterConfig to its Props.",
                                	path);
                }

                var props2 = props;

                // mailbox and dispatcher defined in deploy should override props
                var propsDeploy = lookupDeploy ? Deployer.Lookup(path) : deploy;
                if (propsDeploy != null)
                {
                    if (propsDeploy.Mailbox != Deploy.NoMailboxGiven)
                        props2 = props2.WithMailbox(propsDeploy.Mailbox);
                    if (propsDeploy.Dispatcher != Deploy.NoDispatcherGiven)
                        props2 = props2.WithDispatcher(propsDeploy.Dispatcher);
                }

                if (!system.Dispatchers.HasDispatcher(props2.Dispatcher))
                {
                    throw new ConfigurationException(string.Format("Dispatcher [{0}] not configured for path {1}", props2.Dispatcher, path));
                }

                try
                {
                    // for consistency we check configuration of dispatcher and mailbox locally
                    var dispatcher = _system.Dispatchers.Lookup(props2.Dispatcher);

                    if (async)
                        return
                            new RepointableActorRef(system, props2, dispatcher,
                                () => _system.Mailboxes.CreateMailbox(props2, dispatcher.Configurator.Config), supervisor,
                                path).Initialize(async);
                    return new LocalActorRef(system, props2, dispatcher,
                        () => _system.Mailboxes.CreateMailbox(props2, dispatcher.Configurator.Config), supervisor, path);
                }
                catch (Exception ex)
                {
                    throw new ConfigurationException(
                        string.Format(
                            "Configuration problem while creating {0} with dispatcher [{1}] and mailbox [{2}]", path,
                            props.Dispatcher, props.Mailbox), ex);
                }
            }
            else //routers!!!
            {
                var lookup = (lookupDeploy ? Deployer.Lookup(path) : null) ?? Deploy.None;
                var fromProps = new List<Deploy>() { props.Deploy, deploy, lookup };
                var d = fromProps.Where(x => x != null).Aggregate((deploy1, deploy2) => deploy2.WithFallback(deploy1));
                var p = props.WithRouter(d.RouterConfig);

      
                if (!system.Dispatchers.HasDispatcher(p.Dispatcher))
                    throw new ConfigurationException(string.Format("Dispatcher [{0}] not configured for routees of path {1}", p.Dispatcher, path));
                if (!system.Dispatchers.HasDispatcher(d.RouterConfig.RouterDispatcher))
                    throw new ConfigurationException(string.Format("Dispatcher [{0}] not configured for router of path {1}", p.RouterConfig.RouterDispatcher, path));

                var routerProps = Props.Empty.WithRouter(p.Deploy.RouterConfig).WithDispatcher(p.RouterConfig.RouterDispatcher);
                var routeeProps = props.WithRouter(RouterConfig.NoRouter);

                try
                {
                    var routerDispatcher = system.Dispatchers.Lookup(p.RouterConfig.RouterDispatcher);
                    var routerMailbox = system.Mailboxes.CreateMailbox(routerProps, routerDispatcher.Configurator.Config);

                    // routers use context.actorOf() to create the routees, which does not allow us to pass
                    // these through, but obtain them here for early verification
                    var routeeDispatcher = system.Dispatchers.Lookup(p.Dispatcher);

                    var routedActorRef = new RoutedActorRef(system, routerProps, routerDispatcher, () => routerMailbox, routeeProps,
                        supervisor, path);
                    routedActorRef.Initialize(async);
                    return routedActorRef;
                }
                catch (Exception)
                {
                    throw new ConfigurationException(string.Format("Configuration problem while creating [{0}] with router dispatcher [{1}] and mailbox {2}" +
                                                                   " and routee dispatcher [{3}] and mailbox [{4}].", path, routerProps.Dispatcher, routerProps.Mailbox,
                                                                   routeeProps.Dispatcher, routeeProps.Mailbox));
                }

            }
        }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:89,代码来源:ActorRefProvider.cs


示例20: ResolveActorRef

 internal IInternalActorRef ResolveActorRef(IInternalActorRef actorRef, IReadOnlyCollection<string> pathElements)
 {
     if(pathElements.Count == 0)
     {
         _log.Debug("Resolve of empty path sequence fails (per definition)");
         return _deadLetters;
     }
     var child = actorRef.GetChild(pathElements);
     if(child.IsNobody())
     {
         _log.Debug("Resolve of path sequence [/{0}] failed", ActorPath.FormatPathElements(pathElements));
         return new EmptyLocalActorRef(_system.Provider, actorRef.Path / pathElements, _eventStream);
     }
     return (IInternalActorRef)child;
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:15,代码来源:ActorRefProvider.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IInternalConfigRecord类代码示例发布时间:2022-05-24
下一篇:
C# IInterceptor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap