Akka.Streams.Implementation.IO.OutputStreamSubscriber.Props C# (CSharp) Метод

Props() публичный статический Метод

public static Props ( Stream os, TaskCompletionSource completionPromise, int bufferSize, bool autoFlush ) : Props
os Stream
completionPromise TaskCompletionSource
bufferSize int
autoFlush bool
Результат Props
        public static Props Props(Stream os, TaskCompletionSource<IOResult> completionPromise, int bufferSize, bool autoFlush)
        {
            if (bufferSize <= 0)
                throw new ArgumentException("Buffer size must be > 0");

            return
                Actor.Props.Create(() => new OutputStreamSubscriber(os, completionPromise, bufferSize, autoFlush))
                    .WithDeploy(Deploy.Local);
        }

Usage Example

Пример #1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="context">TBD</param>
        /// <param name="materializer">TBD</param>
        /// <returns>TBD</returns>
        public override object Create(MaterializationContext context, out Task <IOResult> materializer)
        {
            var mat             = ActorMaterializerHelper.Downcast(context.Materializer);
            var settings        = mat.EffectiveSettings(context.EffectiveAttributes);
            var ioResultPromise = new TaskCompletionSource <IOResult>();

            var os       = _createOutput();
            var props    = OutputStreamSubscriber.Props(os, ioResultPromise, settings.MaxInputBufferSize, _autoFlush);
            var actorRef = mat.ActorOf(context, props);

            materializer = ioResultPromise.Task;
            return(new ActorSubscriberImpl <ByteString>(actorRef));
        }