object ActorSource
Collection of Sources aimed at integrating with typed Actors.
- Source
- ActorSource.scala
- Alphabetic
- By Inheritance
- ActorSource
- 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[T](completionMatcher: Predicate[T], failureMatcher: Function[T, Optional[Throwable]], bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, ActorRef[T]]
Creates a
Source
that is materialized as an akka.actor.typed.ActorRef.Creates a
Source
that is materialized as an akka.actor.typed.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received.Depending on the defined akka.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.
The strategy akka.stream.OverflowStrategy.backpressure is not supported, and an IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument.
The buffer can be disabled by using
bufferSize
of 0 and then received messages are dropped if there is no demand from downstream. WhenbufferSize
is 0 theoverflowStrategy
does not matter. An async boundary is added after this Source; as such, it is never safe to assume the downstream will always generate demand.The stream can be completed successfully by sending the actor reference a akka.actor.Status.Success (whose content will be ignored) in which case already buffered elements will be signaled before signaling completion, or by sending akka.actor.PoisonPill in which case completion will be signaled immediately.
The stream can be completed with failure by sending a akka.actor.Status.Failure to the actor reference. In case the Actor is still draining its internal buffer (after having received a akka.actor.Status.Success) before signaling completion and it receives a akka.actor.Status.Failure, the failure will be signaled downstream immediately (instead of the completion signal).
The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.
See also akka.stream.javadsl.Source.queue.
- bufferSize
The size of the buffer in element count
- overflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
-
def
actorRefWithAck[T, Ack](ackTo: ActorRef[Ack], ackMessage: Ack, completionMatcher: Function[T, Optional[CompletionStrategy]], failureMatcher: Function[T, Optional[Throwable]]): Source[T, ActorRef[T]]
Creates a
Source
that is materialized as an akka.actor.ActorRef.Creates a
Source
that is materialized as an akka.actor.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, and a new message will only be accepted after the previous messages has been consumed and acknowledged back. The stream will complete with failure if a message is sent before the acknowledgement has been replied back.The stream can be completed with failure by sending a message that is matched by
failureMatcher
. The extracted Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched bycompletionMatcher
) before signaling completion and it receives a message matched byfailureMatcher
, the failure will be signaled downstream immediately (instead of the completion signal).The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
actorRef[T](completionMatcher: Predicate[T], failureMatcher: PartialFunction[T, Throwable], bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, ActorRef[T]]
Creates a
Source
that is materialized as an akka.actor.typed.ActorRef.Creates a
Source
that is materialized as an akka.actor.typed.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received.Depending on the defined akka.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.
The strategy akka.stream.OverflowStrategy.backpressure is not supported, and an IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument.
The buffer can be disabled by using
bufferSize
of 0 and then received messages are dropped if there is no demand from downstream. WhenbufferSize
is 0 theoverflowStrategy
does not matter. An async boundary is added after this Source; as such, it is never safe to assume the downstream will always generate demand.The stream can be completed successfully by sending the actor reference a akka.actor.Status.Success (whose content will be ignored) in which case already buffered elements will be signaled before signaling completion, or by sending akka.actor.PoisonPill in which case completion will be signaled immediately.
The stream can be completed with failure by sending a akka.actor.Status.Failure to the actor reference. In case the Actor is still draining its internal buffer (after having received a akka.actor.Status.Success) before signaling completion and it receives a akka.actor.Status.Failure, the failure will be signaled downstream immediately (instead of the completion signal).
The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.
See also akka.stream.javadsl.Source.queue.
- bufferSize
The size of the buffer in element count
- overflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
- Annotations
- @deprecated
- Deprecated
(Since version 2.5.23) Use
actorRef
that takes japi function instead
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
- Deprecated
(Since version ) see corresponding Javadoc for more information.