A consumer of elements of type A that may fail with E and, on completion, produces a result Z. Sinks are consumed by passing them to Stream.runAsync (or a platform-specific terminal): the stream compiles into a io.Reader and drains it once to produce the final result.
Type parameters
- A
-
Input element type (contravariant).
- E
-
Error type.
- Z
-
Result type.
Attributes
- Companion
- object
- Source
- Sink.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Applies g to each element as this sink requests it, then feeds the transformed element to this sink. Consumption and short-circuiting are therefore unchanged; g is not evaluated for unread input. Exceptions thrown by g are defects, not values in the sink's typed error channel.
Applies g to each element as this sink requests it, then feeds the transformed element to this sink. Consumption and short-circuiting are therefore unchanged; g is not evaluated for unread input. Exceptions thrown by g are defects, not values in the sink's typed error channel.
Attributes
- Source
- Sink.scala
Sequentially applies the asynchronous function g to each element as this sink requests it. Consumption and short-circuiting are unchanged, so g is not started for unread input. Failure or cancellation of g fails or cancels the run as a defect and stops pulling input.
Sequentially applies the asynchronous function g to each element as this sink requests it. Consumption and short-circuiting are unchanged, so g is not started for unread input. Failure or cancellation of g fails or cancels the run as a defect and stops pulling input.
Attributes
- Source
- Sink.scala
Transforms this sink's successful result after it completes. This does not change input consumption or typed errors. Exceptions thrown by f are defects.
Transforms this sink's successful result after it completes. This does not change input consumption or typed errors. Exceptions thrown by f are defects.
Attributes
- Source
- Sink.scala
Asynchronously transforms this sink's successful result after it completes. The effect is not started when the sink fails, and it does not change input consumption. Effect failure or cancellation fails or cancels the run as a defect.
Asynchronously transforms this sink's successful result after it completes. The effect is not started when the sink fails, and it does not change input consumption. Effect failure or cancellation fails or cancels the run as a defect.
Attributes
- Source
- Sink.scala
Transforms a typed sink error with f, without changing consumption or successful results. Upstream stream errors and defects are not transformed. For an infallible sink (E = Nothing), the evidence avoids allocating a wrapper and f can never be evaluated.
Transforms a typed sink error with f, without changing consumption or successful results. Upstream stream errors and defects are not transformed. For an infallible sink (E = Nothing), the evidence avoids allocating a wrapper and f can never be evaluated.
Attributes
- Source
- Sink.scala
Asynchronously transforms a typed sink error with f. Upstream stream errors, successful results, and defects are unchanged. For E = Nothing, f can never be evaluated; otherwise failure or cancellation of f fails or cancels the run as a defect.
Asynchronously transforms a typed sink error with f. Upstream stream errors, successful results, and defects are unchanged. For E = Nothing, f can never be evaluated; otherwise failure or cancellation of f fails or cancels the run as a defect.
Attributes
- Source
- Sink.scala