Exemplo n.º 1
0
        public static ActorProcessor <TIn, TOut> Create <TIn, TOut>(IActorRef impl)
        {
            var p = new ActorProcessor <TIn, TOut>(impl);

            // Resolve cyclic dependency with actor. This MUST be the first message no matter what.
            impl.Tell(new ExposedPublisher(p));
            return(p);
        }
Exemplo n.º 2
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="context">TBD</param>
        /// <param name="materializer">TBD</param>
        /// <returns>TBD</returns>
        public override object Create(MaterializationContext context, out IPublisher <TIn> materializer)
        {
            var actorMaterializer = ActorMaterializerHelper.Downcast(context.Materializer);
            var settings          = actorMaterializer.EffectiveSettings(Attributes);
            var impl            = actorMaterializer.ActorOf(context, FanoutProcessorImpl <TIn, TStreamBuffer> .Props(settings, _onTerminated));
            var fanoutProcessor = new ActorProcessor <TIn, TIn>(impl);

            impl.Tell(new ExposedPublisher(fanoutProcessor));
            // Resolve cyclic dependency with actor. This MUST be the first message no matter what.
            materializer = fanoutProcessor;
            return(fanoutProcessor);
        }