object Sink
- Alphabetic
- By Inheritance
- Sink
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
actorRef[In](ref: ActorRef, onCompleteMessage: Any): Sink[In, NotUsed]
Sends the elements of the stream to the given
ActorRef.Sends the elements of the stream to the given
ActorRef. If the target actor terminates the stream will be canceled. When the stream is completed successfully the givenonCompleteMessagewill be sent to the destination actor. When the stream is completed with failure a akka.actor.Status.Failure message will be sent to the destination actor.It will request at most
maxInputBufferSizenumber of elements from upstream, but there is no back-pressure signal from the destination actor, i.e. if the actor is not consuming the messages fast enough the mailbox of the actor will grow. For potentially slow consumer actors it is recommended to use a bounded mailbox with zeromailbox-push-timeout-timeor use a rate limiting stage in front of thisSink. -
def
actorRefWithAck[In](ref: ActorRef, onInitMessage: Any, ackMessage: Any, onCompleteMessage: Any, onFailureMessage: Function[Throwable, Any]): Sink[In, NotUsed]
Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signal.Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signal. First element is alwaysonInitMessage, then stream is waiting for acknowledgement messageackMessagefrom the given actor which means that it is ready to process elements. It also requiresackMessagemessage after each stream element to make backpressure work.If the target actor terminates the stream will be canceled. When the stream is completed successfully the given
onCompleteMessagewill be sent to the destination actor. When the stream is completed with failure - result ofonFailureMessage(throwable)message will be sent to the destination actor. -
def
actorSubscriber[T](props: Props): Sink[T, ActorRef]
Creates a
Sinkthat is materialized to an akka.actor.ActorRef which points to an Actor created according to the passed in akka.actor.Props.Creates a
Sinkthat is materialized to an akka.actor.ActorRef which points to an Actor created according to the passed in akka.actor.Props. Actor created by thepropsshould be akka.stream.actor.ActorSubscriber. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asPublisher[T](fanout: AsPublisher): Sink[T, Publisher[T]]
A
Sinkthat materializes into a org.reactivestreams.Publisher.A
Sinkthat materializes into a org.reactivestreams.Publisher.If
fanoutistrue, the materializedPublisherwill support multipleSubscribers and the size of theinputBufferconfigured for this stage becomes the maximum number of elements that the fastest org.reactivestreams.Subscriber can be ahead of the slowest one before slowing the processing down due to back pressure.If
fanoutisfalsethen the materializedPublisherwill only support a singleSubscriberand reject any additionalSubscribers. -
def
cancelled[T](): Sink[T, NotUsed]
A
Sinkthat immediately cancels its upstream after materialization. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
combine[T, U](output1: Sink[U, _], output2: Sink[U, _], rest: List[Sink[U, _]], strategy: Function[Integer, Graph[UniformFanOutShape[T, U], NotUsed]]): Sink[T, NotUsed]
Combine several sinks with fan-out strategy like
BroadcastorBalanceand returnsSink. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fold[U, In](zero: U, f: Function2[U, In, U]): Sink[In, CompletionStage[U]]
A
Sinkthat will invoke the given function for every received element, giving it its previous output (or the givenzerovalue) and the element as input.A
Sinkthat will invoke the given function for every received element, giving it its previous output (or the givenzerovalue) and the element as input. The returned java.util.concurrent.CompletionStage will be completed with value of the final function evaluation when the input stream ends, or completed withFailureif there is a failure is signaled in the stream. -
def
foldAsync[U, In](zero: U, f: Function2[U, In, CompletionStage[U]]): Sink[In, CompletionStage[U]]
A
Sinkthat will invoke the given asynchronous function for every received element, giving it its previous output (or the givenzerovalue) and the element as input.A
Sinkthat will invoke the given asynchronous function for every received element, giving it its previous output (or the givenzerovalue) and the element as input. The returned java.util.concurrent.CompletionStage will be completed with value of the final function evaluation when the input stream ends, or completed withFailureif there is a failure is signaled in the stream. -
def
foreach[T](f: Procedure[T]): Sink[T, CompletionStage[Done]]
A
Sinkthat will invoke the given procedure for each received element.A
Sinkthat will invoke the given procedure for each received element. The sink is materialized into a java.util.concurrent.CompletionStage will be completed withSuccesswhen reaching the normal end of the stream, or completed withFailureif there is a failure is signaled in the stream.. -
def
foreachParallel[T](parallel: Int)(f: Procedure[T])(ec: ExecutionContext): Sink[T, CompletionStage[Done]]
A
Sinkthat will invoke the given procedure for each received element in parallel.A
Sinkthat will invoke the given procedure for each received element in parallel. The sink is materialized into a java.util.concurrent.CompletionStage.If
fthrows an exception and the supervision decision is akka.stream.Supervision.Stop theCompletionStagewill be completed with failure.If
fthrows an exception and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream continues. -
def
fromGraph[T, M](g: Graph[SinkShape[T], M]): Sink[T, M]
A graph with the shape of a sink logically is a sink, this method makes it so also in type.
-
def
fromSubscriber[In](subs: Subscriber[In]): Sink[In, NotUsed]
Helper to create Sink from
Subscriber. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
head[In](): Sink[In, CompletionStage[In]]
A
Sinkthat materializes into aCompletionStageof the first value received.A
Sinkthat materializes into aCompletionStageof the first value received. If the stream completes before signaling at least a single element, the CompletionStage will be failed with a NoSuchElementException. If the stream signals an error before signaling at least a single element, the CompletionStage will be failed with the streams exception.See also headOption.
-
def
headOption[In](): Sink[In, CompletionStage[Optional[In]]]
A
Sinkthat materializes into aCompletionStageof the optional first value received.A
Sinkthat materializes into aCompletionStageof the optional first value received. If the stream completes before signaling at least a single element, the value of the CompletionStage will be an empty java.util.Optional. If the stream signals an error errors before signaling at least a single element, the CompletionStage will be failed with the streams exception.See also head.
-
def
ignore[T](): Sink[T, CompletionStage[Done]]
A
Sinkthat will consume the stream and discard the elements. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last[In](): Sink[In, CompletionStage[In]]
A
Sinkthat materializes into aCompletionStageof the last value received.A
Sinkthat materializes into aCompletionStageof the last value received. If the stream completes before signaling at least a single element, the CompletionStage will be failed with a NoSuchElementException. If the stream signals an error errors before signaling at least a single element, the CompletionStage will be failed with the streams exception.See also lastOption.
-
def
lastOption[In](): Sink[In, CompletionStage[Optional[In]]]
A
Sinkthat materializes into aCompletionStageof the optional last value received.A
Sinkthat materializes into aCompletionStageof the optional last value received. If the stream completes before signaling at least a single element, the value of the CompletionStage will be an empty java.util.Optional. If the stream signals an error errors before signaling at least a single element, the CompletionStage will be failed with the streams exception.See also head.
-
def
lazyInit[T, M](sinkFactory: Function[T, CompletionStage[Sink[T, M]]], fallback: Creator[M]): Sink[T, CompletionStage[M]]
Creates a real
Sinkupon receiving the first element.Creates a real
Sinkupon receiving the first element. InternalSinkwill not be created if there are no elements, because of completion or error.If
sinkFactorythrows an exception and the supervision decision is akka.stream.Supervision.Stop theFuturewill be completed with failure. For all other supervision options it will try to create sink with next elementfallbackwill be executed when there was no elements and completed is received from upstream. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
onComplete[In](callback: Procedure[Try[Done]]): Sink[In, NotUsed]
A
Sinkthat when the flow is completed, either through a failure or normal completion, apply the provided function with scala.util.Success or scala.util.Failure. -
def
queue[T](): Sink[T, SinkQueueWithCancel[T]]
Creates a
Sinkthat is materialized as an akka.stream.javadsl.SinkQueue.Creates a
Sinkthat is materialized as an akka.stream.javadsl.SinkQueue. akka.stream.javadsl.SinkQueue.pull method is pulling element from the stream and returns.CompletionStage[Option[T]]CompletionStagecompletes when element is available.Before calling pull method second time you need to wait until previous CompletionStage completes. Pull returns Failed future with IllegalStateException if previous future has not yet completed.
Sinkwill request at most number of elements equal to size ofinputBufferfrom upstream and then stop back pressure. You can configure size of input buffer by using Sink.withAttributes method.For stream completion you need to pull all elements from akka.stream.javadsl.SinkQueue including last None as completion marker
-
def
reduce[In](f: Function2[In, In, In]): Sink[In, CompletionStage[In]]
A
Sinkthat will invoke the given function for every received element, giving it its previous output (from the second element) and the element as input.A
Sinkthat will invoke the given function for every received element, giving it its previous output (from the second element) and the element as input. The returned java.util.concurrent.CompletionStage will be completed with value of the final function evaluation when the input stream ends, or completed withFailureif there is a failure signaled in the stream.If the stream is empty (i.e. completes before signalling any elements), the reduce stage will fail its downstream with a NoSuchElementException, which is semantically in-line with that Scala's standard library collections do in such situations.
-
def
seq[In]: Sink[In, CompletionStage[List[In]]]
A
Sinkthat keeps on collecting incoming elements until upstream terminates.A
Sinkthat keeps on collecting incoming elements until upstream terminates. As upstream may be unbounded,Flow[T].takeor the stricterFlow[T].limit(and their variants) may be used to ensure boundedness. Materializes into aCompletionStageofSeq[T]containing all the collected elements.Listis limited toInteger.MAX_VALUEelements, this Sink will cancel the stream after having received that many elements.See also Flow.limit, Flow.limitWeighted, Flow.take, Flow.takeWithin, Flow.takeWhile
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )