com.fsist.stream

AsyncStreamProducer

Related Doc: package stream

trait AsyncStreamProducer[+Out] extends StreamProducer[Out] with AsyncFunc[Unit, Out] with NewBuilder

A trait that allows implementing a custom StreamInput that produces items asynchronously.

This often allows writing more elegant code for complex stateful producers.

Linear Supertypes
NewBuilder, AsyncFunc[Unit, Out], Func[Unit, Out], StreamProducer[Out], StreamInput[Out], SourceComponentBase[Out], SourceComponent[Out], SourceOps[Out], StreamComponentBase, StreamComponent, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncStreamProducer
  2. NewBuilder
  3. AsyncFunc
  4. Func
  5. StreamProducer
  6. StreamInput
  7. SourceComponentBase
  8. SourceComponent
  9. SourceOps
  10. StreamComponentBase
  11. StreamComponent
  12. AnyRef
  13. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def produce()(implicit ec: ExecutionContext): Future[Out]

    Called to produce each successive element in the stream.

    Called to produce each successive element in the stream. Should throw a EndOfStreamException to indicate EOF.

    Equivalent to StreamInput.producer. See the README for concurrency issues.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def append[Super >: Out](elems: Iterable[Super]): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  5. def appendThese[Super >: Out](elems: Super*): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  6. final def apply(a: Unit)(implicit ec: ExecutionContext): Future[Out]

    The core abstract method that must be implemented by each instance, providing the function behavior.

    The core abstract method that must be implemented by each instance, providing the function behavior.

    Definition Classes
    AsyncStreamProducerAsyncFunc
  7. def asAsync: AsyncFunc[Unit, Out]

    Shortcut for a cast to AsyncFunc.

    Shortcut for a cast to AsyncFunc. Fails at runtime with ClassCastException if this function is synchronous.

    Definition Classes
    Func
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def asSync: SyncFunc[Unit, Out]

    Shortcut for a cast to SyncFunc.

    Shortcut for a cast to SyncFunc. Fails at runtime with ClassCastException if this function is asynchronous.

    Definition Classes
    Func
  10. def build()(implicit ec: ExecutionContext): RunningStream

    Materializes the stream, including all components linked (transitively) to this one, and starts running it.

    Materializes the stream, including all components linked (transitively) to this one, and starts running it.

    The same result is produced no matter which stream component is used to call build.

    This method may only be called once per stream (see README on the subject of reusing components).

    Definition Classes
    StreamComponent
  11. implicit def builder: FutureStreamBuilder

    Definition Classes
    NewBuilder
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def collect[M[_]]()(implicit cbf: CanBuildFrom[Nothing, Out, M[Out]]): Transform[_ <: Out, M[Out]]

    Definition Classes
    SourceOps
  14. def collectSuper[Super >: Out, M[_]]()(implicit cbf: CanBuildFrom[Nothing, Super, M[Super]]): Transform[Super, M[Super]]

    This overload of collect lets you specify an explicit supertype bound of Out (so you cannot upcast past it) and in exchange get a precise non-existential return type.

    This overload of collect lets you specify an explicit supertype bound of Out (so you cannot upcast past it) and in exchange get a precise non-existential return type.

    Definition Classes
    SourceOps
  15. def compose[C](next: Func[Out, C])(implicit ec: ExecutionContext): Func[Unit, C]

    Creates a new function composing these two, which is synchronous iff both inputs were synchronous.

    Creates a new function composing these two, which is synchronous iff both inputs were synchronous.

    Definition Classes
    AsyncFuncFunc
  16. def composeFailure(handler: (Throwable) ⇒ Unit)(implicit ec: ExecutionContext): Func[Unit, Out]

    Returns a new function that passes any exceptions in the original function to handler.

    Returns a new function that passes any exceptions in the original function to handler. The new function still fails with the original exception after the handler has run.

    The returned Func is synchronous iff the original func is synchronous.

    Definition Classes
    Func
  17. def concat[Elem, Super >: Out]()(implicit ev: <:<[Super, TraversableOnce[Elem]], cbf: CanBuildFrom[Nothing, Elem, Super]): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  18. def concatWith[Super >: Out](sources: SourceComponent[Super]*): SourceComponent[Super]

    Concatenate these sources after the current one.

    Concatenate these sources after the current one.

    This is named concatWith and not simply Concat because SourceOps.concat refers to the unrelated Transform.concat.

    Definition Classes
    SourceOps
    See also

    com.fsist.stream.Source.concat

  19. def connect(next: SinkComponent[Out]): next.type

    Irreversibly join this source with that sink.

    Irreversibly join this source with that sink.

    Definition Classes
    SourceComponent
  20. def discard(): StreamOutput[_ <: Out, Unit]

    Definition Classes
    SourceOps
  21. def drive[Res](consumer: StreamConsumer[Out, Res]): StreamOutput[_ <: Out, Res]

    Definition Classes
    SourceOps
  22. def drop(count: Long): SourceComponent[Out]

    Definition Classes
    SourceOps
  23. def dropElements[Elem](count: Long)(implicit ev: <:<[Out, Traversable[Elem]], cbf: CanBuildFrom[Nothing, Elem, Out]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. def filter(filter: (Out) ⇒ Boolean)(implicit ec: ExecutionContext): SourceComponent[Out]

    Definition Classes
    SourceOps
  27. def filterAsync(filter: (Out) ⇒ Future[Boolean])(implicit ec: ExecutionContext): SourceComponent[Out]

    Definition Classes
    SourceOps
  28. def filterFunc(filter: Func[Out, Boolean])(implicit ec: ExecutionContext): SourceComponent[Out]

    Definition Classes
    SourceOps
  29. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def flatMap[Next](mapper: (Out) ⇒ Iterable[Next], onComplete: ⇒ Iterable[Next]): SourceComponent[Next]

    Definition Classes
    SourceOps
  31. def flatMap[Next](mapper: (Out) ⇒ Iterable[Next]): SourceComponent[Next]

    Definition Classes
    SourceOps
  32. def flatMapAsync[Next](mapper: (Out) ⇒ Future[Iterable[Next]], onComplete: ⇒ Future[Iterable[Next]]): SourceComponent[Next]

    Definition Classes
    SourceOps
  33. def flatMapAsync[Next](mapper: (Out) ⇒ Future[Iterable[Next]]): SourceComponent[Next]

    Definition Classes
    SourceOps
  34. def flatMapFunc[Next](mapper: Func[Out, Iterable[Next]], onComplete: Func[Unit, Iterable[Next]] = Func(emptyIterable)): SourceComponent[Next]

    Definition Classes
    SourceOps
  35. def flatten[Elem]()(implicit ev: <:<[Out, Iterable[Elem]]): SourceComponent[Elem]

    Definition Classes
    SourceOps
  36. def fold[Super >: Out, Res](init: Res)(onNext: (Res, Super) ⇒ Res): SourceComponent[Res]

    Definition Classes
    SourceOps
  37. def foldAsync[Super >: Out, Res](init: Res)(onNext: ((Res, Super)) ⇒ Future[Res]): SourceComponent[Res]

    Definition Classes
    SourceOps
  38. def foldFunc[Super >: Out, Res](init: Res)(onNext: Func[(Res, Super), Res]): SourceComponent[Res]

    Definition Classes
    SourceOps
  39. def foreach[Super >: Out, Res](func: (Super) ⇒ Unit, onComplete: ⇒ Res, onError: (Throwable) ⇒ Unit): StreamOutput[Super, Res]

    Definition Classes
    SourceOps
  40. def foreach[Super >: Out, Res](func: (Super) ⇒ Unit, onComplete: ⇒ Res): StreamOutput[Super, Res]

    Definition Classes
    SourceOps
  41. def foreach[Super >: Out](func: (Super) ⇒ Unit): StreamOutput[Super, Unit]

    Definition Classes
    SourceOps
  42. def foreachAsync[Super >: Out, Res](func: (Super) ⇒ Future[Unit], onComplete: ⇒ Future[Res], onError: (Throwable) ⇒ Unit): StreamOutput[Super, Res]

    Definition Classes
    SourceOps
  43. def foreachAsync[Super >: Out, Res](func: (Super) ⇒ Future[Unit], onComplete: ⇒ Future[Res]): StreamOutput[Super, Res]

    Definition Classes
    SourceOps
  44. def foreachAsync[Super >: Out](func: (Super) ⇒ Future[Unit]): StreamOutput[Super, Unit]

    Definition Classes
    SourceOps
  45. def foreachFunc[Super >: Out, Res](func: Func[Super, Unit], onComplete: Func[Unit, Res] = Func.nop, onError: Func[Throwable, Unit] = Func.nop): StreamOutput[Super, Res]

    Definition Classes
    SourceOps
  46. def foreachTr(func: (Out) ⇒ Unit): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  47. def foreachTrAsync(func: (Out) ⇒ Future[Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  48. def foreachTrFunc(func: Func[Out, Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  49. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  50. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  51. def head(): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  52. def headOption(): Transform[_ <: Out, Option[Out]]

    Definition Classes
    SourceOps
  53. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  54. def isNop: Boolean

    Returns true iff this function is either Func.nop or Func.nopAsync.

    Returns true iff this function is either Func.nop or Func.nopAsync.

    Definition Classes
    Func
  55. def isPass: Boolean

    Returns true iff this is a function built by Func.pass.

    Returns true iff this is a function built by Func.pass.

    Definition Classes
    Func
  56. def isSync: Boolean

    Returns true iff this is a SyncFunc

    Returns true iff this is a SyncFunc

    Definition Classes
    AsyncFuncFunc
  57. def map[Next](mapper: (Out) ⇒ Next, onComplete: ⇒ Unit): SourceComponent[Next]

    Definition Classes
    SourceOps
  58. def map[Next](mapper: (Out) ⇒ Next): SourceComponent[Next]

    Definition Classes
    SourceOps
  59. def mapAsync[Next](mapper: (Out) ⇒ Future[Next], onComplete: ⇒ Future[Unit]): SourceComponent[Next]

    Definition Classes
    SourceOps
  60. def mapAsync[Next](mapper: (Out) ⇒ Future[Next]): SourceComponent[Next]

    Definition Classes
    SourceOps
  61. def mapFunc[Next](mapper: Func[Out, Next], onComplete: Func[Unit, Unit] = Func.nop): SourceComponent[Next]

    Definition Classes
    SourceOps
  62. def merge[Super >: Out](sources: SourceComponent[Super]*): Merger[Super]

    Definition Classes
    SourceOps
  63. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  64. final def notify(): Unit

    Definition Classes
    AnyRef
  65. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  66. def onComplete(onComplete: ⇒ Unit): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  67. def onCompleteAsync(onComplete: ⇒ Future[Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  68. def onCompleteFunc(onComplete: Func[Unit, Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  69. def onError(throwable: Throwable): Unit

    Called if the stream fails.

    Called if the stream fails. Equivalent to StreamInput.onError. See the README for concurrency issues.

  70. final def onError: Func[Throwable, Unit]

    Definition Classes
    AsyncStreamProducerStreamProducer
  71. def onError(onError: (Throwable) ⇒ Unit): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  72. def onErrorAsync(onError: (Throwable) ⇒ Future[Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  73. def onErrorFunc(onError: Func[Throwable, Unit]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  74. def prepend[Super >: Out](elems: Iterable[Super]): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  75. def prependThese[Super >: Out](elems: Super*): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  76. final def producer: Func[Unit, Out]

    Called non-concurrently to produce the source elements.

    Called non-concurrently to produce the source elements. To indicate EOF, this function needs to throw a EndOfStreamException.

    Definition Classes
    AsyncStreamProducerStreamProducer
  77. def recover[U >: Out](handler: PartialFunction[Throwable, U])(implicit ec: ExecutionContext): Func[Unit, U]

    Adds a synchronous recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    Adds a synchronous recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    If this is a SyncFunc, the result will also be synchronous.

    Definition Classes
    AsyncFuncFunc
  78. def recoverWith[U >: Out](handler: PartialFunction[Throwable, Future[U]])(implicit ec: ExecutionContext): AsyncFunc[Unit, U]

    Adds an asynchronous recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    Adds an asynchronous recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    This isn't declared to return an AsyncFunc because it can discard the handler and return a SyncFunc if the original function is e.g. nop or pass.

    Definition Classes
    AsyncFuncFunc
  79. def roundRobin(outputCount: Int): Splitter[_ <: Out]

    Definition Classes
    SourceOps
  80. def scatter(outputCount: Int): Scatterer[_ <: Out]

    Definition Classes
    SourceOps
  81. def single(): StreamOutput[_, Out]

    Definition Classes
    SourceOps
  82. def singleResult()(implicit ec: ExecutionContext): Future[Out]

    Definition Classes
    SourceOps
  83. def someApply(a: Unit)(implicit ec: ExecutionContext): Future[Out]

    Returns either B or a Future[B] depending on the type of this Func.

    Returns either B or a Future[B] depending on the type of this Func.

    Definition Classes
    AsyncFuncFunc
  84. def someRecover[U >: Out](handler: Func[Throwable, U])(implicit ec: ExecutionContext): Func[Unit, U]

    Adds a recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    Adds a recovery stage to this function, which handles both synchronously thrown exceptions, and failing futures returned by asynchronous functions.

    If this and handler are both synchronous, then the result will also be synchronous.

    Because the handler is a Func, it cannot be a partial function; it must handle all NonFatal exceptions. Exceptions that don't match the NonFatal extractor will not be passed to the handler.

    Definition Classes
    Func
  85. def sourceComponent: SourceComponent[Out]

    Attributes
    protected
    Definition Classes
    SourceComponentSourceOps
  86. def split(outputCount: Int, outputChooser: (Out) ⇒ BitSet): Splitter[_ <: Out]

    Definition Classes
    SourceOps
  87. def splitAsync(outputCount: Int, outputChooser: (Out) ⇒ Future[BitSet]): Splitter[_ <: Out]

    Definition Classes
    SourceOps
  88. def splitFunc(outputCount: Int, outputChooser: Func[Out, BitSet]): Splitter[_ <: Out]

    Definition Classes
    SourceOps
  89. def suppressErrors()(implicit ec: ExecutionContext): Func[Unit, Unit]

    Suppress all errors matched by the NonFatal extractor.

    Suppress all errors matched by the NonFatal extractor. If this is synchronous, the result is also synchronous.

    Definition Classes
    AsyncFuncFunc
  90. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  91. def take(count: Long): SourceComponent[Out]

    Definition Classes
    SourceOps
  92. def takeElements[Elem](count: Long)(implicit ev: <:<[Out, Traversable[Elem]], cbf: CanBuildFrom[Nothing, Elem, Out]): Transform[_ <: Out, Out]

    Definition Classes
    SourceOps
  93. def tapHead(): Transform[_ <: Out, Out] with Aside[Option[Out]]

    Definition Classes
    SourceOps
  94. def tee(outputCount: Int): Splitter[_ <: Out]

    Definition Classes
    SourceOps
  95. def to[Res](sink: Sink[Out, Res]): sink.type

    Irreversibly join this source with that sink.

    Irreversibly join this source with that sink.

    Definition Classes
    SourceComponent
  96. def to[Next](pipe: Pipe[Out, Next]): pipe.type

    Irreversibly join this source with that pipe's sink.

    Irreversibly join this source with that pipe's sink.

    Definition Classes
    SourceComponent
  97. def to(sink: SinkComponent[Out]): sink.type

    Irreversibly join this source with that sink.

    Irreversibly join this source with that sink.

    Definition Classes
    SourceComponent
  98. def toIndexedSeq(): Transform[_ <: Out, IndexedSeq[Out]]

    Definition Classes
    SourceOps
  99. def toList(): Transform[_ <: Out, List[Out]]

    Definition Classes
    SourceOps
  100. def toSeq(): Transform[_ <: Out, Seq[Out]]

    Definition Classes
    SourceOps
  101. def toSet[Super >: Out](): Transform[_ <: Out, Set[Super]]

    Definition Classes
    SourceOps
  102. def toString(): String

    Definition Classes
    AnyRef → Any
  103. def toVector(): Transform[_ <: Out, Vector[Out]]

    Definition Classes
    SourceOps
  104. def transform[Next](tr: Transform[Out, Next]): tr.type

    Irreversibly join this source with that transform.

    Irreversibly join this source with that transform.

    Definition Classes
    SourceComponent
  105. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  106. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  107. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. def ~>[C](next: Func[Out, C])(implicit ec: ExecutionContext): Func[Unit, C]

    Alias for compose.

    Alias for compose. Creates a new function composing these two, which is synchronous iff both inputs were synchronous.

    Definition Classes
    Func

Inherited from NewBuilder

Inherited from AsyncFunc[Unit, Out]

Inherited from Func[Unit, Out]

Inherited from StreamProducer[Out]

Inherited from StreamInput[Out]

Inherited from SourceComponentBase[Out]

Inherited from SourceComponent[Out]

Inherited from SourceOps[Out]

Inherited from StreamComponentBase

Inherited from StreamComponent

Inherited from AnyRef

Inherited from Any

Ungrouped