Exemplo n.º 1
0
        public void Tell_TracedMessageAndExceptionDuringProcessing_TracerScopeDisposed()
        {
            //setup
            IAkkaTracer tracer = Substitute.For <IAkkaTracer>();
            IScope      scope  = Substitute.For <IScope>();

            tracer.AroundReceive(null, null, null).ReturnsForAnyArgs(scope);

            var tep = new TracingExtensionProvider(new SubsTracingExtensionFactory(tracer));

            Sys.RegisterExtension(tep);
            var testActor = new TestActorRef <SampleActor>(Sys, Props.Create(() => new SampleActor())); //sync actor

            //call
            testActor.Tell(new TracedMessage("exception", null));

            //assert
            scope.ReceivedWithAnyArgs(1).Dispose();
        }
 public virtual TracingExtension CreateTracingExtension(IAkkaTracer akkaTracer)
 {
     return(new TracingExtension(akkaTracer));
 }
Exemplo n.º 3
0
 internal TracingExtension(IAkkaTracer akkaTracer)
 {
     AkkaTracer = akkaTracer;
 }
Exemplo n.º 4
0
 internal TracedActorRef(IActorRefProvider provider, IActorRef @delegate, IAkkaTracer tracer)
 {
     _provider = provider;
     _delegate = @delegate;
     _tracer   = tracer;
 }
Exemplo n.º 5
0
 internal TracedMessageQueue(IMessageQueue @delegate, IAkkaTracer tracer)
 {
     _delegate = @delegate;
     _tracer   = tracer;
 }
Exemplo n.º 6
0
 internal SubsTracingExtensionFactory(IAkkaTracer tracer)
 {
     _tracer = tracer;
 }
Exemplo n.º 7
0
 protected override void PreStart()
 {
     _tracer = Context.System.GetExtension <TracingExtension>()?.AkkaTracer;
     base.PreStart();
 }
 internal TracedRemoteActorRef(RemoteActorRef @delegate, IAkkaTracer tracer)
 {
     _delegate = @delegate;
     _tracer   = tracer;
 }