public static Props ( |
||
f | ||
completionPromise | TaskCompletionSource |
|
bufferSize | int | |
fileMode | FileMode | |
리턴 | Props |
/// <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 props = FileSubscriber.Props(_f, ioResultPromise, settings.MaxInputBufferSize, _fileMode); var dispatcher = context.EffectiveAttributes.GetAttribute(DefaultAttributes.IODispatcher.AttributeList.First()) as ActorAttributes.Dispatcher; var actorRef = mat.ActorOf(context, props.WithDispatcher(dispatcher.Name)); materializer = ioResultPromise.Task; return(new ActorSubscriberImpl <ByteString>(actorRef)); }
/// <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 props = FileSubscriber.Props(_f, ioResultPromise, settings.MaxInputBufferSize, _startPosition, _fileMode, _autoFlush, _flushSignaler); var actorRef = mat.ActorOf( context, props.WithDispatcher(context .EffectiveAttributes .GetMandatoryAttribute <ActorAttributes.Dispatcher>() .Name)); materializer = ioResultPromise.Task; return(new ActorSubscriberImpl <ByteString>(actorRef)); }