WIP initial typed streams adapters
Adapt ref source and sink for typed * do not use the typed teskit temporarily
This commit is contained in:
parent
84b8f3ac29
commit
171bb6c231
16 changed files with 657 additions and 39 deletions
|
|
@ -99,19 +99,24 @@ import akka.util.OptionVal
|
|||
* INTERNAL API
|
||||
*/
|
||||
@InternalApi private[akka] final class ActorRefSource[Out](
|
||||
bufferSize: Int, overflowStrategy: OverflowStrategy, val attributes: Attributes, shape: SourceShape[Out])
|
||||
completionMatcher: PartialFunction[Any, Unit],
|
||||
failureMatcher: PartialFunction[Any, Throwable],
|
||||
bufferSize: Int, overflowStrategy: OverflowStrategy, val attributes: Attributes, shape: SourceShape[Out])
|
||||
extends SourceModule[Out, ActorRef](shape) {
|
||||
|
||||
override protected def label: String = s"ActorRefSource($bufferSize, $overflowStrategy)"
|
||||
|
||||
override def create(context: MaterializationContext) = {
|
||||
val mat = ActorMaterializerHelper.downcast(context.materializer)
|
||||
val ref = mat.actorOf(context, ActorRefSourceActor.props(bufferSize, overflowStrategy, mat.settings))
|
||||
val ref = mat.actorOf(context, ActorRefSourceActor.props(
|
||||
completionMatcher,
|
||||
failureMatcher,
|
||||
bufferSize, overflowStrategy, mat.settings))
|
||||
(akka.stream.actor.ActorPublisher[Out](ref), ref)
|
||||
}
|
||||
|
||||
override protected def newInstance(shape: SourceShape[Out]): SourceModule[Out, ActorRef] =
|
||||
new ActorRefSource[Out](bufferSize, overflowStrategy, attributes, shape)
|
||||
new ActorRefSource[Out](completionMatcher, failureMatcher, bufferSize, overflowStrategy, attributes, shape)
|
||||
override def withAttributes(attr: Attributes): SourceModule[Out, ActorRef] =
|
||||
new ActorRefSource(bufferSize, overflowStrategy, attr, amendShape(attr))
|
||||
new ActorRefSource(completionMatcher, failureMatcher, bufferSize, overflowStrategy, attr, amendShape(attr))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue