final class Sink[-In, +Mat] extends Graph[SinkShape[In], Mat]
A Sink
is a set of stream processing steps that has one open input.
Can be used as a Subscriber
- Source
- Sink.scala
- Alphabetic
- By Inheritance
- Sink
- Graph
- AnyRef
- Any
- by GraphMapMatVal
- by SinkToCompletionStage
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Sink[In, Mat], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addAttributes(attr: Attributes): Sink[In, Mat]
Add the given attributes to this Sink.
Add the given attributes to this Sink. If the specific attribute was already present on this graph this means the added attribute will be more specific than the existing one. If this Sink is a composite of multiple graphs, new attributes on the composite will be less specific than attributes set directly on the individual graphs of the composite.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava[JIn <: In]: javadsl.Sink[JIn, Mat]
Converts this Scala DSL element to it's Java DSL counterpart.
- def async(dispatcher: String, inputBufferSize: Int): Sink[In, Mat]
Put an asynchronous boundary around this
Graph
- def async(dispatcher: String): Sink[In, Mat]
Put an asynchronous boundary around this
Graph
- def async: Sink[In, Mat]
Put an asynchronous boundary around this
Source
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def contramap[In2](f: (In2) => In): Sink[In2, Mat]
Transform this Sink by applying a function to each *incoming* upstream element before it is passed to the Sink
- def ensuring(cond: (Sink[In, Mat]) => Boolean, msg: => Any): Sink[In, Mat]
- def ensuring(cond: (Sink[In, Mat]) => Boolean): Sink[In, Mat]
- def ensuring(cond: Boolean, msg: => Any): Sink[In, Mat]
- def ensuring(cond: Boolean): Sink[In, Mat]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getAttributes: Attributes
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapMaterializedValue[Mat2](f: (Mat) => Mat2): Sink[In, Mat2]
Transform only the materialized value of this Sink, leaving all other properties as they were.
- def named(name: String): Sink[In, Mat]
Add a
attribute to this Sink.name
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def preMaterialize()(implicit materializer: Materializer): (Mat, Sink[In, NotUsed])
Materializes this Sink, immediately returning (1) its materialized value, and (2) a new Sink that can be consume elements 'into' the pre-materialized one.
Materializes this Sink, immediately returning (1) its materialized value, and (2) a new Sink that can be consume elements 'into' the pre-materialized one.
Useful for when you need a materialized value of a Sink when handing it out to someone to materialize it for you.
- def runWith[Mat2](source: Graph[SourceShape[In], Mat2])(implicit materializer: Materializer): Mat2
Connect this
Sink
to aSource
and run it.Connect this
Sink
to aSource
and run it. The returned value is the materialized value of theSource
, e.g. theSubscriber
of a Source#subscriber.Note that the
ActorSystem
can be used as the implicitmaterializer
parameter to use the pekko.stream.SystemMaterializer for running the stream. - val shape: SinkShape[In]
The shape of a graph is all that is externally visible: its inlets and outlets.
- val sink: Sink[In, Future[T]]
- Implicit
- This member is added by an implicit conversion from Sink[In, Mat] toSinkToCompletionStage[In, T] performed by method SinkToCompletionStage in org.apache.pekko.stream.scaladsl.This conversion will take place only if Mat is a subclass of Future[T] (Mat <: Future[T]).
- Definition Classes
- SinkToCompletionStage
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toCompletionStage(): Sink[In, CompletionStage[T]]
- Implicit
- This member is added by an implicit conversion from Sink[In, Mat] toSinkToCompletionStage[In, T] performed by method SinkToCompletionStage in org.apache.pekko.stream.scaladsl.This conversion will take place only if Mat is a subclass of Future[T] (Mat <: Future[T]).
- Definition Classes
- SinkToCompletionStage
- def toString(): String
- Definition Classes
- Sink → AnyRef → Any
- val traversalBuilder: LinearTraversalBuilder
INTERNAL API.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withAttributes(attr: Attributes): Sink[In, Mat]
Replace the attributes of this Sink with the given ones.
Shadowed Implicit Value Members
- def mapMaterializedValue[M2](f: (Mat) => M2): Graph[SinkShape[In], M2]
Transform the materialized value of this Graph, leaving all other properties as they were.
Transform the materialized value of this Graph, leaving all other properties as they were.
- f
function to map the graph's materialized value
- Implicit
- This member is added by an implicit conversion from Sink[In, Mat] toGraphMapMatVal[SinkShape[In], Mat] performed by method GraphMapMatVal in org.apache.pekko.stream.Graph.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(sink: GraphMapMatVal[SinkShape[In], Mat]).mapMaterializedValue(f)
- Definition Classes
- GraphMapMatVal
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Sink[In, Mat] toStringFormat[Sink[In, Mat]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (Sink[In, Mat], B)
- Implicit
- This member is added by an implicit conversion from Sink[In, Mat] toArrowAssoc[Sink[In, Mat]] performed by method ArrowAssoc in scala.Predef.This conversion will take place only if Mat is a subclass of Future[Nothing] (Mat <: Future[Nothing]).
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.