com.fsist.stream

SyncStreamProducer

Related Doc: package stream

trait SyncStreamProducer[+Out] extends StreamProducer[Out] with SyncFunc[Unit, Out] with NewBuilder

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

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

Linear Supertypes
NewBuilder, SyncFunc[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. SyncStreamProducer
  2. NewBuilder
  3. SyncFunc
  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(): 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): 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
    SyncStreamProducerSyncFunc
  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: SyncFunc[Out, C]): SyncFunc[Unit, C]

    This overload acts like Func.compose, but because it composes two SyncFuncs, it doesn't need an ExecutionContext.

    This overload acts like Func.compose, but because it composes two SyncFuncs, it doesn't need an ExecutionContext.

    Definition Classes
    SyncFunc
  16. 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
    SyncFuncFunc
  17. 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
  18. def concat[Elem, Super >: Out]()(implicit ev: <:<[Super, TraversableOnce[Elem]], cbf: CanBuildFrom[Nothing, Elem, Super]): Transform[_ <: Out, Super]

    Definition Classes
    SourceOps
  19. 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

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

    Irreversibly join this source with that sink.

    Irreversibly join this source with that sink.

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

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

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

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

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

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

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

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

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

    Definition Classes
    SourceOps
  30. def finalize(): Unit

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    SourceOps
  46. 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
  47. def foreachTr(func: (Out) ⇒ Unit): Transform[_ <: Out, Out]

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

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

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

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

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

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

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

    Definition Classes
    Any
  55. 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
  56. 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
  57. def isSync: Boolean

    Returns true iff this is a SyncFunc

    Returns true iff this is a SyncFunc

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    SourceOps
  70. 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.

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

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

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

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

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

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

    Definition Classes
    SourceOps
  77. 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
    SyncStreamProducerStreamProducer
  78. 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
    SyncFuncFunc
  79. def recoverWith[U >: Out](handler: PartialFunction[Throwable, Future[U]])(implicit ec: ExecutionContext): Func[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
    SyncFuncFunc
  80. def roundRobin(outputCount: Int): Splitter[_ <: Out]

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

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

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

    Definition Classes
    SourceOps
  84. def someApply(a: Unit)(implicit ec: ExecutionContext): 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
    SyncFuncFunc
  85. 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
  86. def sourceComponent: SourceComponent[Out]

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

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

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

    Definition Classes
    SourceOps
  90. 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
    SyncFuncFunc
  91. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Definition Classes
    SourceOps
  96. 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
  97. 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
  98. def to(sink: SinkComponent[Out]): sink.type

    Irreversibly join this source with that sink.

    Irreversibly join this source with that sink.

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

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

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

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

    Definition Classes
    SourceOps
  103. def toString(): String

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

    Definition Classes
    SourceOps
  105. 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
  106. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. def ~>[C](next: SyncFunc[Out, C]): SyncFunc[Unit, C]

    Alias for compose.

    Alias for compose. This overload acts like Func.compose, but because it composes two SyncFuncs, it doesn't need an ExecutionContext.

    Definition Classes
    SyncFunc
  110. 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 SyncFunc[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