trait SinkRef[In] extends AnyRef
A SinkRef allows sharing a "reference" to a Sink with others, with the main purpose of crossing a network boundary. Usually obtaining a SinkRef would be done via Actor messaging, in which one system asks a remote one, to accept some data from it, and the remote one decides to accept the request to send data in a back-pressured streaming fashion -- using a sink ref.
To create a SinkRef you have to materialize the Sink that you want to obtain a reference to by attaching it to a StreamRefs.sinkRef().
Stream refs can be seen as Reactive Streams over network boundaries.
See also akka.stream.SourceRef which is the dual of a SinkRef.
For additional configuration see reference.conf as well as akka.stream.StreamRefAttributes.
- Source
- StreamRefs.scala
- Alphabetic
- By Inheritance
- SinkRef
- AnyRef
- Any
- by convertRefToSink
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
def
addAttributes(attr: Attributes): Sink[In, NotUsed]
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.
-
def
asJava[JIn <: In, JMat >: Mat]: Sink[JIn, JMat]
Converts this Scala DSL element to it's Java DSL counterpart.
Converts this Scala DSL element to it's Java DSL counterpart.
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- Definition Classes
- Sink
-
def
async(dispatcher: String, inputBufferSize: Int): Sink[In, NotUsed]
Put an asynchronous boundary around this
GraphPut an asynchronous boundary around this
Graph- dispatcher
Run the graph on this dispatcher
- inputBufferSize
Set the input buffer to this size for the graph
-
def
async(dispatcher: String): Sink[In, NotUsed]
Put an asynchronous boundary around this
Graph -
def
async: Sink[In, NotUsed]
Put an asynchronous boundary around this
Source -
def
contramap[In2](f: (In2) ⇒ In): Sink[In2, NotUsed]
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 cancels
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- Definition Classes
- Sink
-
final
def
getSink(): Sink[In, NotUsed]
Java API: Get javadsl.Sink underlying to this source ref.
-
def
mapMaterializedValue[Mat2](f: (NotUsed) ⇒ 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.
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- Definition Classes
- Sink
-
def
named(name: String): Sink[In, NotUsed]
Add a
attribute to this Sink.name -
def
preMaterialize()(implicit materializer: Materializer): (NotUsed, 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.
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- Definition Classes
- Sink
-
def
runWith[Mat2](source: Graph[SourceShape[In], Mat2])(implicit materializer: Materializer): Mat2
Connect this
Sinkto aSourceand run it.Connect this
Sinkto aSourceand run it. The returned value is the materialized value of theSource, e.g. theSubscriberof a Source#subscriber.- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- Definition Classes
- Sink
-
val
shape: SinkShape[In]
The shape of a graph is all that is externally visible: its inlets and outlets.
-
val
traversalBuilder: LinearTraversalBuilder
INTERNAL API.
-
def
withAttributes(attr: Attributes): Sink[In, NotUsed]
Replace the attributes of this Sink with the given ones.
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.
Shadowed Implicit Value Members
-
def
toString(): String
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to Sink[In, NotUsed] performed by method convertRefToSink in akka.stream.SinkRef.
- 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:(sinkRef: Sink[In, NotUsed]).toString()
- Definition Classes
- Sink → AnyRef → Any