Beispiel #1
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();
        }
Beispiel #2
0
 protected AkkaPduCodec(ActorSystem system)
 {
     System       = system;
     AddressCache = AddressThreadLocalCache.For(system);
 }