예제 #1
0
        /// <inheritdoc/>
        public virtual void Init(ActorSystemImpl system)
        {
            _system = system;

            _local.Init(system);

            _actorRefResolveThreadLocalCache = ActorRefResolveThreadLocalCache.For(system);
            _actorPathThreadLocalCache       = ActorPathThreadLocalCache.For(system);

            _remotingTerminator =
                _system.SystemActorOf(
                    RemoteSettings.ConfigureDispatcher(Props.Create(() => new RemotingTerminator(_local.SystemGuardian))),
                    "remoting-terminator");

            _internals = CreateInternals();

            _remotingTerminator.Tell(RemoteInternals);

            Transport.Start();
            _remoteWatcher           = CreateRemoteWatcher(system);
            _remoteDeploymentWatcher = CreateRemoteDeploymentWatcher(system);
        }
예제 #2
0
        public async Task Setup()
        {
            _sys1         = ActorSystem.Create("BenchSys", _config);
            _resolveCache = ActorRefResolveThreadLocalCache.For(_sys1);
            _pathCache    = ActorPathThreadLocalCache.For(_sys1);
            _addressCache = AddressThreadLocalCache.For(_sys1);

            var es = (ExtendedActorSystem)_sys1;

            _addr1       = es.Provider.DefaultAddress;
            _addr1String = _addr1.ToString();

            var name = "target" + ++_cacheHitPathCount;

            _cacheHitActorRef = _sys1.ActorOf(act =>
            {
                act.ReceiveAny((o, context) => context.Sender.Tell(context.Sender));
            }, name);

            _cacheMissActorRef = await _cacheHitActorRef.Ask <IActorRef>("hit", CancellationToken.None);

            _cacheHitPath  = _cacheHitActorRef.Path.ToString();
            _cacheMissPath = _cacheMissActorRef.Path.ToString();
        }
예제 #3
0
 protected AkkaPduCodec(ActorSystem system)
 {
     System         = system;
     ActorPathCache = ActorPathThreadLocalCache.For(system);
 }