trait FlowExt extends AnyRef
- Alphabetic
- By Inheritance
- FlowExt
- 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
customStatefulProcessor[A, B, C](zero: ⇒ B)(f: (B, A) ⇒ (Option[B], IndexedSeq[C]), lastPushIfUpstreamEnds: (B) ⇒ IndexedSeq[C] = _: B => IndexedSeq.empty): Flow[A, C, NotUsed]
Fold and/or unfold the stream with an user-defined function.
Fold and/or unfold the stream with an user-defined function.
- zero
initial state
- f
takes current state and current elem, returns a seq of C elements to push downstream and the next state b if we want the stream to continue (if no new state b, the stream ends).
- lastPushIfUpstreamEnds
if the upstream ends (before customStatefulProcessor decides to end the stream), this function is called on the last b state and the resulting c elements are pushed downstream as the last elements of the stream.
-
def
customStatelessProcessor[A, B](f: (A) ⇒ (IndexedSeq[B], Boolean)): Flow[A, B, NotUsed]
Unfold a stream with an user-defined function.
Unfold a stream with an user-defined function.
- f
take current elem, and return a seq of B elems with a stop boolean (true means that we want the stream to stop after sending the joined seq of B elems)
-
def
debounce[A](per: FiniteDuration, toHash: (A) ⇒ String): Flow[A, A, NotUsed]
Create a Flow which debounce messages with similar hashes
-
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[A, B](zero: ⇒ B)(f: (B, A) ⇒ B): Flow[A, B, NotUsed]
Fold the stream and push the last B to downstream when upstream finishes.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
rateLimiter[A](interval: FiniteDuration): Flow[A, A, NotUsed]
Limit downstream rate to one element every 'interval' by applying back-pressure on upstream.
Limit downstream rate to one element every 'interval' by applying back-pressure on upstream.
- interval
time interval to send one element downstream
-
def
rechunkByteStringBySeparator(separator: ByteString, maximumChunkBytes: Int): Flow[ByteString, ByteString, NotUsed]
Rechunk of stream of bytes according to a separator
Rechunk of stream of bytes according to a separator
- separator
the separator to split the stream. For example ByteString("\n") to split a stream by lines.
- maximumChunkBytes
the maximum possible size of a split to send downstream (in bytes). If no separator is found before reaching this limit, the stream fails.
-
def
rechunkByteStringBySize(chunkSize: Int): Flow[ByteString, ByteString, NotUsed]
Rechunk a stream of bytes according to a chunk size.
Rechunk a stream of bytes according to a chunk size.
- chunkSize
the new chunk size
-
def
repeatEach[A](nb: Int): Flow[A, A, NotUsed]
Repeat each element of the source 'nb' times.
Repeat each element of the source 'nb' times.
- nb
the number of repetitions
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
takeWhile[A](f: (A) ⇒ Boolean): Flow[A, A, NotUsed]
Consume the stream while condition is true.
Consume the stream while condition is true.
- f
condition
-
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( ... )
-
def
withHead[A, B, M](includeHeadInUpStream: Boolean)(f: (A) ⇒ Flow[A, B, M]): Flow[A, B, NotUsed]
Create a Flow whose creation depends on the first element of the upstream.
Create a Flow whose creation depends on the first element of the upstream.
- includeHeadInUpStream
true if we want the first element of the upstream to be included in the dowstream.
- f
takes the first element of upstream in input and returns the resulting flow
- returns
the flow returned by f
-
def
zipWithConstantLazyAsync[A, B](futB: ⇒ Future[B]): Flow[A, (A, B), NotUsed]
Zip a stream with a lazy future that will be evaluated only when the stream is materialized.
-
def
zipWithIndex[A]: Flow[A, (A, Long), NotUsed]
Zip a stream with the indices of its elements.