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.
Not for user extension.
- Annotations
- @DoNotInherit()
- 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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (SinkRef[In], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava[JIn <: In]: Sink[JIn, NotUsed]
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
Graph
Put 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
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
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
- def ensuring(cond: (SinkRef[In]) ⇒ Boolean, msg: ⇒ Any): SinkRef[In]
- def ensuring(cond: (SinkRef[In]) ⇒ Boolean): SinkRef[In]
- def ensuring(cond: Boolean, msg: ⇒ Any): SinkRef[In]
- def ensuring(cond: Boolean): SinkRef[In]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def getAttributes: Attributes
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
getSink(): Sink[In, NotUsed]
Java API: Get javadsl.Sink underlying to this source ref.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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.
Note that
preMaterialize
is implemented through a reactive streamsSubscriber
which means that a buffer is introduced and that errors are not propagated upstream but are turned into cancellations without error details.- 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
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 akka.stream.SystemMaterializer for running the stream.- 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.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
traversalBuilder: LinearTraversalBuilder
INTERNAL API.
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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.
- def →[B](y: B): (SinkRef[In], B)
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
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from SinkRef[In] to StringFormat[SinkRef[In]] 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.