Object/Class

akka.stream.scaladsl

Sink

Related Docs: class Sink | package scaladsl

Permalink

object Sink

Source
Sink.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Sink
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def actorRef[T](ref: ActorRef, onCompleteMessage: Any): Sink[T, NotUsed]

    Permalink

    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 given onCompleteMessage will 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 maxInputBufferSize number 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 zero mailbox-push-timeout-time or use a rate limiting stage in front of this Sink.

  5. def actorRefWithAck[T](ref: ActorRef, onInitMessage: Any, ackMessage: Any, onCompleteMessage: Any, onFailureMessage: (Throwable) ⇒ Any = Status.Failure): Sink[T, NotUsed]

    Permalink

    Sends the elements of the stream to the given ActorRef that sends back back-pressure signal.

    Sends the elements of the stream to the given ActorRef that sends back back-pressure signal. First element is always onInitMessage, then stream is waiting for acknowledgement message ackMessage from the given actor which means that it is ready to process elements. It also requires ackMessage message 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 onCompleteMessage will be sent to the destination actor. When the stream is completed with failure - result of onFailureMessage(throwable) function will be sent to the destination actor.

  6. def actorSubscriber[T](props: Props): Sink[T, ActorRef]

    Permalink

    Creates a Sink that is materialized to an akka.actor.ActorRef which points to an Actor created according to the passed in akka.actor.Props.

    Creates a Sink that is materialized to an akka.actor.ActorRef which points to an Actor created according to the passed in akka.actor.Props. Actor created by the props must be akka.stream.actor.ActorSubscriber.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def asPublisher[T](fanout: Boolean): Sink[T, Publisher[T]]

    Permalink

    A Sink that materializes into a org.reactivestreams.Publisher.

    A Sink that materializes into a org.reactivestreams.Publisher.

    If fanout is true, the materialized Publisher will support multiple Subscribers and the size of the inputBuffer configured 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 fanout is false then the materialized Publisher will only support a single Subscriber and reject any additional Subscribers.

  9. def cancelled[T]: Sink[T, NotUsed]

    Permalink

    A Sink that immediately cancels its upstream after materialization.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def combine[T, U](first: Sink[U, _], second: Sink[U, _], rest: Sink[U, _]*)(strategy: (Int) ⇒ Graph[UniformFanOutShape[T, U], NotUsed]): Sink[T, NotUsed]

    Permalink

    Combine several sinks with fan-out strategy like Broadcast or Balance and returns Sink.

  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fold[U, T](zero: U)(f: (U, T) ⇒ U): Sink[T, Future[U]]

    Permalink

    A Sink that will invoke the given function for every received element, giving it its previous output (or the given zero value) and the element as input.

    A Sink that will invoke the given function for every received element, giving it its previous output (or the given zero value) and the element as input. The returned scala.concurrent.Future will be completed with value of the final function evaluation when the input stream ends, or completed with Failure if there is a failure signaled in the stream.

  16. def foreach[T](f: (T) ⇒ Unit): Sink[T, Future[Done]]

    Permalink

    A Sink that will invoke the given procedure for each received element.

    A Sink that will invoke the given procedure for each received element. The sink is materialized into a scala.concurrent.Future will be completed with Success when reaching the normal end of the stream, or completed with Failure if there is a failure signaled in the stream..

  17. def foreachParallel[T](parallelism: Int)(f: (T) ⇒ Unit)(implicit ec: ExecutionContext): Sink[T, Future[Done]]

    Permalink

    A Sink that will invoke the given function to each of the elements as they pass in.

    A Sink that will invoke the given function to each of the elements as they pass in. The sink is materialized into a scala.concurrent.Future

    If f throws an exception and the supervision decision is akka.stream.Supervision.Stop the Future will be completed with failure.

    If f throws an exception and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream continues.

    See also

    #mapAsyncUnordered

  18. def fromGraph[T, M](g: Graph[SinkShape[T], M]): Sink[T, M]

    Permalink

    A graph with the shape of a sink logically is a sink, this method makes it so also in type.

  19. def fromSubscriber[T](subscriber: Subscriber[T]): Sink[T, NotUsed]

    Permalink

    Helper to create Sink from Subscriber.

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. def head[T]: Sink[T, Future[T]]

    Permalink

    A Sink that materializes into a Future of the first value received.

    A Sink that materializes into a Future of the first value received. If the stream completes before signaling at least a single element, the Future will be failed with a NoSuchElementException. If the stream signals an error errors before signaling at least a single element, the Future will be failed with the streams exception.

    See also headOption.

  23. def headOption[T]: Sink[T, Future[Option[T]]]

    Permalink

    A Sink that materializes into a Future of the optional first value received.

    A Sink that materializes into a Future of the optional first value received. If the stream completes before signaling at least a single element, the value of the Future will be None. If the stream signals an error errors before signaling at least a single element, the Future will be failed with the streams exception.

    See also head.

  24. def ignore: Sink[Any, Future[Done]]

    Permalink

    A Sink that will consume the stream and discard the elements.

  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. def last[T]: Sink[T, Future[T]]

    Permalink

    A Sink that materializes into a Future of the last value received.

    A Sink that materializes into a Future of the last value received. If the stream completes before signaling at least a single element, the Future will be failed with a NoSuchElementException. If the stream signals an error errors before signaling at least a single element, the Future will be failed with the streams exception.

    See also lastOption.

  27. def lastOption[T]: Sink[T, Future[Option[T]]]

    Permalink

    A Sink that materializes into a Future of the optional last value received.

    A Sink that materializes into a Future of the optional last value received. If the stream completes before signaling at least a single element, the value of the Future will be None. If the stream signals an error errors before signaling at least a single element, the Future will be failed with the streams exception.

    See also last.

  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def onComplete[T](callback: (Try[Done]) ⇒ Unit): Sink[T, NotUsed]

    Permalink

    A Sink that when the flow is completed, either through a failure or normal completion, apply the provided function with scala.util.Success or scala.util.Failure.

  32. def queue[T](): Sink[T, SinkQueue[T]]

    Permalink

    Creates a Sink that is materialized as an akka.stream.SinkQueue.

    Creates a Sink that is materialized as an akka.stream.SinkQueue. akka.stream.SinkQueue.pull method is pulling element from the stream and returns Future[Option[T]]. Future completes when element is available.

    Before calling pull method second time you need to wait until previous Future completes. Pull returns Failed future with IllegalStateException if previous future has not yet completed.

    Sink will request at most number of elements equal to size of inputBuffer from 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.SinkQueue including last None as completion marker

    See also

    akka.stream.SinkQueue

  33. def reduce[T](f: (T, T) ⇒ T): Sink[T, Future[T]]

    Permalink

    A Sink that will invoke the given function for every received element, giving it its previous output (from the second element) and the element as input.

    A Sink that 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 scala.concurrent.Future will be completed with value of the final function evaluation when the input stream ends, or completed with Failure if there is a failure signaled in the stream.

  34. def seq[T]: Sink[T, Future[Seq[T]]]

    Permalink

    A Sink that keeps on collecting incoming elements until upstream terminates.

    A Sink that keeps on collecting incoming elements until upstream terminates. As upstream may be unbounded, Flow[T].take or the stricter Flow[T].limit (and their variants) may be used to ensure boundedness. Materializes into a Future of Seq[T] containing all the collected elements. Seq is limited to Int.MaxValue elements, this Sink will cancel the stream after having received that many elements.

    See also Flow.limit, Flow.limitWeighted, Flow.take, Flow.takeWithin, Flow.takeWhile

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped