Sink

org.apache.pekko.stream.javadsl.Sink
See theSink companion object
final class Sink[In, Mat](delegate: Sink[In, Mat]) extends Graph[SinkShape[In], Mat]

Java API

A Sink is a set of stream processing steps that has one open input. Can be used as a Subscriber

Attributes

Companion
object
Source
Sink.scala
Graph
Supertypes
trait Graph[SinkShape[In], Mat]
class Object
trait Matchable
class Any

Members list

Type members

Inherited types

type Shape = SinkShape[In]

Type-level accessor for the shape parameter of this graph.

Type-level accessor for the shape parameter of this graph.

Attributes

Inherited from:
Graph
Source
Graph.scala

Value members

Concrete methods

override def addAttributes(attr: Attributes): Sink[In, Mat]

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.

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.

Attributes

Definition Classes
Source
Sink.scala
def asScala: Sink[In, Mat]

Converts this Sink to its Scala DSL counterpart.

Converts this Sink to its Scala DSL counterpart.

Attributes

Source
Sink.scala
override def async: Sink[In, Mat]

Put an asynchronous boundary around this Sink

Put an asynchronous boundary around this Sink

Attributes

Definition Classes
Source
Sink.scala
override def async(dispatcher: String): Sink[In, Mat]

Put an asynchronous boundary around this Sink

Put an asynchronous boundary around this Sink

Value parameters

dispatcher

Run the graph on this dispatcher

Attributes

Definition Classes
Source
Sink.scala
override def async(dispatcher: String, inputBufferSize: Int): Sink[In, Mat]

Put an asynchronous boundary around this Sink

Put an asynchronous boundary around this Sink

Value parameters

dispatcher

Run the graph on this dispatcher

inputBufferSize

Set the input buffer to this size for the graph

Attributes

Definition Classes
Source
Sink.scala
def contramap[In2](f: Function[In2, In]): Sink[In2, Mat]

Transform this Sink by applying a function to each incoming upstream element before it is passed to the Sink

Transform this Sink by applying a function to each incoming upstream element before it is passed to the Sink

'''Backpressures when''' original Sink backpressures

'''Cancels when''' original Sink backpressures

Attributes

Source
Sink.scala
override def getAttributes: Attributes

Attributes

Definition Classes
Source
Sink.scala
def mapMaterializedValue[Mat2](f: Function[Mat, Mat2]): Sink[In, Mat2]

Transform only the materialized value of this Sink, leaving all other properties as they were.

Transform only the materialized value of this Sink, leaving all other properties as they were.

Attributes

Source
Sink.scala
override def named(name: String): Sink[In, Mat]

Add a name attribute to this Sink.

Add a name attribute to this Sink.

Attributes

Definition Classes
Source
Sink.scala
def preMaterialize(systemProvider: ClassicActorSystemProvider): Pair[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.

Note that the ActorSystem can be used as the systemProvider parameter.

Attributes

Source
Sink.scala
def preMaterialize(materializer: Materializer): Pair[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.

Prefer the method taking an ActorSystem unless you have special requirements.

Attributes

Source
Sink.scala
def runWith[M](source: Graph[SourceShape[In], M], systemProvider: ClassicActorSystemProvider): M

Connect this Sink to a Source and run it.

Connect this Sink to a Source and run it.

Note that the ActorSystem can be used as the systemProvider parameter.

Attributes

Source
Sink.scala
def runWith[M](source: Graph[SourceShape[In], M], materializer: Materializer): M

Connect this Sink to a Source and run it.

Connect this Sink to a Source and run it.

Attributes

Source
Sink.scala
override def shape: SinkShape[In]

The shape of a graph is all that is externally visible: its inlets and outlets.

The shape of a graph is all that is externally visible: its inlets and outlets.

Attributes

Definition Classes
Source
Sink.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Sink.scala
override def traversalBuilder: LinearTraversalBuilder

INTERNAL API.

INTERNAL API.

Every materializable element must be backed by a stream layout module

Attributes

Definition Classes
Source
Sink.scala
override def withAttributes(attr: Attributes): Sink[In, Mat]

Replace the attributes of this Sink with the given ones. 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.

Replace the attributes of this Sink with the given ones. 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.

Attributes

Definition Classes
Source
Sink.scala