com.fsist.stream

AsyncStreamConsumer

Related Doc: package stream

trait AsyncStreamConsumer[-In, +Res] extends StreamConsumer[In, Res] with AsyncFunc[In, Unit] with NewBuilder

A trait that allows implementing a custom StreamOutput that processes items asynchronously.

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

Linear Supertypes
NewBuilder, AsyncFunc[In, Unit], Func[In, Unit], StreamConsumer[In, Res], StreamOutput[In, Res], SinkComponent[In], StreamComponentBase, StreamComponent, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncStreamConsumer
  2. NewBuilder
  3. AsyncFunc
  4. Func
  5. StreamConsumer
  6. StreamOutput
  7. SinkComponent
  8. StreamComponentBase
  9. StreamComponent
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def complete()(implicit ec: ExecutionContext): Future[Res]

    Called on EOF to produce the final result.

    Called on EOF to produce the final result.

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

  2. abstract def onNext(in: In)(implicit ec: ExecutionContext): Future[Unit]

    Called to process each successive element in the stream.

    Called to process each successive element in the stream.

    Equivalent to StreamOutput.onNext. 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. final def apply(in: In)(implicit ec: ExecutionContext): Future[Unit]

    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
    AsyncStreamConsumerAsyncFunc
  5. def asAsync: AsyncFunc[In, Unit]

    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
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def asSync: SyncFunc[In, Unit]

    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
  8. 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
  9. def buildAndGet()(implicit ec: ExecutionContext): RunningOutput[In, Res]

    A shortcut method that calls build and returns the RunningStreamComponent representing this.

    A shortcut method that calls build and returns the RunningStreamComponent representing this.

    Definition Classes
    StreamOutput
  10. def buildResult()(implicit ec: ExecutionContext): Future[Res]

    A shortcut method that calls build and returns the future result produced by this component.

    A shortcut method that calls build and returns the future result produced by this component.

    Definition Classes
    StreamOutput
  11. implicit def builder: FutureStreamBuilder

    Definition Classes
    NewBuilder
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def compose[C](next: Func[Unit, C])(implicit ec: ExecutionContext): Func[In, 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
  14. def composeFailure(handler: (Throwable) ⇒ Unit)(implicit ec: ExecutionContext): Func[In, Unit]

    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
  15. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def futureResult(): Future[Res]

    Returns the result future that will eventually be completed when the stream runs.

    Returns the result future that will eventually be completed when the stream runs. This is identical to the Future returned by the RunningStream for this component, which is also returned by buildResult.

    This method is useful when you want to know about the completion and/or the result in a location other than the one where you actually run the stream, such as when you produce a Sink and give it to someone else to use.

    Definition Classes
    StreamOutput
  19. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. 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
  23. 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
  24. def isSync: Boolean

    Returns true iff this is a SyncFunc

    Returns true iff this is a SyncFunc

    Definition Classes
    AsyncFuncFunc
  25. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  28. final def onComplete: Func[Unit, Res]

    Called on each input element, non-concurrently with itself and onNext.

    Called on each input element, non-concurrently with itself and onNext.

    Can only be called once, and no more calls to onNext are allowed afterwards.

    Definition Classes
    AsyncStreamConsumerStreamConsumer
  29. 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.

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

    Called if the stream fails.

    Called if the stream fails. See the README on the semantics of stream failure. This method is guaranteed to be called exactly once.

    This is called *concurrently* with onNext and onComplete.

    Definition Classes
    AsyncStreamConsumerStreamConsumer
  31. final def onNext: Func[In, Unit]

    Called on each input element, non-concurrently with itself and onComplete.

    Called on each input element, non-concurrently with itself and onComplete.

    Definition Classes
    AsyncStreamConsumerStreamConsumer
  32. def recover[U >: Unit](handler: PartialFunction[Throwable, U])(implicit ec: ExecutionContext): Func[In, 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
  33. def recoverWith[U >: Unit](handler: PartialFunction[Throwable, Future[U]])(implicit ec: ExecutionContext): AsyncFunc[In, 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
  34. def someApply(a: In)(implicit ec: ExecutionContext): Future[Unit]

    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
  35. def someRecover[U >: Unit](handler: Func[Throwable, U])(implicit ec: ExecutionContext): Func[In, 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
  36. def suppressErrors()(implicit ec: ExecutionContext): Func[In, 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
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. def toString(): String

    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def ~>[C](next: Func[Unit, C])(implicit ec: ExecutionContext): Func[In, 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[In, Unit]

Inherited from Func[In, Unit]

Inherited from StreamConsumer[In, Res]

Inherited from StreamOutput[In, Res]

Inherited from SinkComponent[In]

Inherited from StreamComponentBase

Inherited from StreamComponent

Inherited from AnyRef

Inherited from Any

Ungrouped