consistent wording; stream ops are "operators" (#25064)
This commit is contained in:
parent
d2f2d50b6b
commit
7fa28b3488
15 changed files with 73 additions and 73 deletions
|
|
@ -178,7 +178,7 @@ but if 2 or more `Future`s are involved `map` will not allow you to combine them
|
||||||
|
|
||||||
@@snip [FutureDocSpec.scala]($code$/scala/docs/future/FutureDocSpec.scala) { #flat-map }
|
@@snip [FutureDocSpec.scala]($code$/scala/docs/future/FutureDocSpec.scala) { #flat-map }
|
||||||
|
|
||||||
Composing futures using nested combinators it can sometimes become quite complicated and hard to read, in these cases using Scala's
|
Composing futures using nested operators it can sometimes become quite complicated and hard to read, in these cases using Scala's
|
||||||
'for comprehensions' usually yields more readable code. See next section for examples.
|
'for comprehensions' usually yields more readable code. See next section for examples.
|
||||||
|
|
||||||
If you need to do conditional propagation, you can use `filter`:
|
If you need to do conditional propagation, you can use `filter`:
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ Scala
|
||||||
Java
|
Java
|
||||||
: @@snip [PersistenceQueryDocTest.java]($code$/java/jdocs/persistence/PersistenceQueryDocTest.java) { #events-by-tag }
|
: @@snip [PersistenceQueryDocTest.java]($code$/java/jdocs/persistence/PersistenceQueryDocTest.java) { #events-by-tag }
|
||||||
|
|
||||||
As you can see, we can use all the usual stream combinators available from @ref:[Streams](stream/index.md) on the resulting query stream,
|
As you can see, we can use all the usual stream operators available from @ref:[Streams](stream/index.md) on the resulting query stream,
|
||||||
including for example taking the first 10 and cancelling the stream. It is worth pointing out that the built-in `EventsByTag`
|
including for example taking the first 10 and cancelling the stream. It is worth pointing out that the built-in `EventsByTag`
|
||||||
query has an optionally supported offset parameter (of type `Long`) which the journals can use to implement resumable-streams.
|
query has an optionally supported offset parameter (of type `Long`) which the journals can use to implement resumable-streams.
|
||||||
For example a journal may be able to use a WHERE clause to begin the read starting from a specific row, or in a datastore
|
For example a journal may be able to use a WHERE clause to begin the read starting from a specific row, or in a datastore
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ we have a stream of streams, where every substream will serve identical words.
|
||||||
To count the words, we need to process the stream of streams (the actual groups
|
To count the words, we need to process the stream of streams (the actual groups
|
||||||
containing identical words). `groupBy` returns a @scala[`SubFlow`] @java[`SubSource`], which
|
containing identical words). `groupBy` returns a @scala[`SubFlow`] @java[`SubSource`], which
|
||||||
means that we transform the resulting substreams directly. In this case we use
|
means that we transform the resulting substreams directly. In this case we use
|
||||||
the `reduce` combinator to aggregate the word itself and the number of its
|
the `reduce` operator to aggregate the word itself and the number of its
|
||||||
occurrences within a @scala[tuple `(String, Integer)`] @java[`Pair<String, Integer>`]. Each substream will then
|
occurrences within a @scala[tuple `(String, Integer)`] @java[`Pair<String, Integer>`]. Each substream will then
|
||||||
emit one final value—precisely such a pair—when the overall input completes. As
|
emit one final value—precisely such a pair—when the overall input completes. As
|
||||||
a last step we merge back these values from the substreams into one single
|
a last step we merge back these values from the substreams into one single
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,7 @@ or the downstreams. Even for stages that do not complete or fail in this manner,
|
||||||
|
|
||||||
@@@ div { .group-scala }
|
@@@ div { .group-scala }
|
||||||
|
|
||||||
## Extending Flow Combinators with Custom Operators
|
## Extending Flow Operators with Custom Operators
|
||||||
|
|
||||||
The most general way of extending any `Source`, `Flow` or `SubFlow` (e.g. from `groupBy`) is
|
The most general way of extending any `Source`, `Flow` or `SubFlow` (e.g. from `groupBy`) is
|
||||||
demonstrated above: create a graph of flow-shape like the `Duplicator` example given above and use the `.via(...)`
|
demonstrated above: create a graph of flow-shape like the `Duplicator` example given above and use the `.via(...)`
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ is needed in order to allow the stream to run at all, you will have to insert ex
|
||||||
|
|
||||||
Since every processing stage in Akka Streams can provide a materialized value after being materialized, it is necessary
|
Since every processing stage in Akka Streams can provide a materialized value after being materialized, it is necessary
|
||||||
to somehow express how these values should be composed to a final value when we plug these stages together. For this,
|
to somehow express how these values should be composed to a final value when we plug these stages together. For this,
|
||||||
many combinator methods have variants that take an additional argument, a function, that will be used to combine the
|
many operator methods have variants that take an additional argument, a function, that will be used to combine the
|
||||||
resulting values. Some examples of using these combiners are illustrated in the example below.
|
resulting values. Some examples of using these combiners are illustrated in the example below.
|
||||||
|
|
||||||
Scala
|
Scala
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ Scala
|
||||||
Java
|
Java
|
||||||
: @@snip [QuickStartDocTest.java]($code$/java/jdocs/stream/QuickStartDocTest.java) { #transform-source }
|
: @@snip [QuickStartDocTest.java]($code$/java/jdocs/stream/QuickStartDocTest.java) { #transform-source }
|
||||||
|
|
||||||
First we use the `scan` combinator to run a computation over the whole
|
First we use the `scan` operator to run a computation over the whole
|
||||||
stream: starting with the number 1 (@scala[`BigInt(1)`]@java[`BigInteger.ONE`]) we multiple by each of
|
stream: starting with the number 1 (@scala[`BigInt(1)`]@java[`BigInteger.ONE`]) we multiple by each of
|
||||||
the incoming numbers, one after the other; the scan operation emits the initial
|
the incoming numbers, one after the other; the scan operation emits the initial
|
||||||
value and then every calculation result. This yields the series of factorial
|
value and then every calculation result. This yields the series of factorial
|
||||||
|
|
@ -185,7 +185,7 @@ Java
|
||||||
All operations so far have been time-independent and could have been performed
|
All operations so far have been time-independent and could have been performed
|
||||||
in the same fashion on strict collections of elements. The next line
|
in the same fashion on strict collections of elements. The next line
|
||||||
demonstrates that we are in fact dealing with streams that can flow at a
|
demonstrates that we are in fact dealing with streams that can flow at a
|
||||||
certain speed: we use the `throttle` combinator to slow down the stream to 1
|
certain speed: we use the `throttle` operator to slow down the stream to 1
|
||||||
element per second.
|
element per second.
|
||||||
|
|
||||||
If you run this program you will see one line printed per second. One aspect
|
If you run this program you will see one line printed per second. One aspect
|
||||||
|
|
@ -195,14 +195,14 @@ JVM does not crash with an OutOfMemoryError, even though you will also notice
|
||||||
that running the streams happens in the background, asynchronously (this is the
|
that running the streams happens in the background, asynchronously (this is the
|
||||||
reason for the auxiliary information to be provided as a @scala[`Future`]@java[`CompletionStage`], in the future). The
|
reason for the auxiliary information to be provided as a @scala[`Future`]@java[`CompletionStage`], in the future). The
|
||||||
secret that makes this work is that Akka Streams implicitly implement pervasive
|
secret that makes this work is that Akka Streams implicitly implement pervasive
|
||||||
flow control, all combinators respect back-pressure. This allows the throttle
|
flow control, all operators respect back-pressure. This allows the throttle
|
||||||
combinator to signal to all its upstream sources of data that it can only
|
combinator to signal to all its upstream sources of data that it can only
|
||||||
accept elements at a certain rate—when the incoming rate is higher than one per
|
accept elements at a certain rate—when the incoming rate is higher than one per
|
||||||
second the throttle combinator will assert *back-pressure* upstream.
|
second the throttle operator will assert *back-pressure* upstream.
|
||||||
|
|
||||||
This is basically all there is to Akka Streams in a nutshell—glossing over the
|
This is basically all there is to Akka Streams in a nutshell—glossing over the
|
||||||
fact that there are dozens of sources and sinks and many more stream
|
fact that there are dozens of sources and sinks and many more stream
|
||||||
transformation combinators to choose from, see also @ref:[operator index](operators/index.md).
|
transformation operators to choose from, see also @ref:[operator index](operators/index.md).
|
||||||
|
|
||||||
# Reactive Tweets
|
# Reactive Tweets
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Java
|
||||||
The same strategy can be applied for sources as well. In the next example we
|
The same strategy can be applied for sources as well. In the next example we
|
||||||
have a source that produces an infinite stream of elements. Such source can be
|
have a source that produces an infinite stream of elements. Such source can be
|
||||||
tested by asserting that first arbitrary number of elements hold some
|
tested by asserting that first arbitrary number of elements hold some
|
||||||
condition. Here the `take` combinator and `Sink.seq` are very useful.
|
condition. Here the `take` operator and `Sink.seq` are very useful.
|
||||||
|
|
||||||
Scala
|
Scala
|
||||||
: @@snip [StreamTestKitDocSpec.scala]($code$/scala/docs/stream/StreamTestKitDocSpec.scala) { #grouped-infinite }
|
: @@snip [StreamTestKitDocSpec.scala]($code$/scala/docs/stream/StreamTestKitDocSpec.scala) { #grouped-infinite }
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ A side-effect of this is that behaviors can now be tested in isolation without
|
||||||
having to be packaged into an Actor, tests can run fully synchronously without
|
having to be packaged into an Actor, tests can run fully synchronously without
|
||||||
having to worry about timeouts and spurious failures. Another side-effect is
|
having to worry about timeouts and spurious failures. Another side-effect is
|
||||||
that behaviors can nicely be composed and decorated, for example `Behaviors.tap`
|
that behaviors can nicely be composed and decorated, for example `Behaviors.tap`
|
||||||
is not special or using something internal. New combinators can be written as
|
is not special or using something internal. New operators can be written as
|
||||||
external libraries or tailor-made for each project.
|
external libraries or tailor-made for each project.
|
||||||
|
|
||||||
## A Little Bit of Theory
|
## A Little Bit of Theory
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ class FlowDelaySpec extends StreamSpec {
|
||||||
.withAttributes(inputBuffer(16, 16))
|
.withAttributes(inputBuffer(16, 16))
|
||||||
.runWith(TestSink.probe[Int])
|
.runWith(TestSink.probe[Int])
|
||||||
.request(100)
|
.request(100)
|
||||||
.expectError(new BufferOverflowException("Buffer overflow for delay combinator (max capacity was: 16)!"))
|
.expectError(new BufferOverflowException("Buffer overflow for delay operator (max capacity was: 16)!"))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1667,7 +1667,7 @@ private[stream] object Collect {
|
||||||
}
|
}
|
||||||
case Fail ⇒
|
case Fail ⇒
|
||||||
() ⇒ {
|
() ⇒ {
|
||||||
failStage(new BufferOverflowException(s"Buffer overflow for delay combinator (max capacity was: $size)!"))
|
failStage(new BufferOverflowException(s"Buffer overflow for delay operator (max capacity was: $size)!"))
|
||||||
}
|
}
|
||||||
case Backpressure ⇒
|
case Backpressure ⇒
|
||||||
() ⇒ {
|
() ⇒ {
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ object Flow {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
||||||
* fan-in combinators where you do not want to pay the cost of casting each element in a `map`.
|
* fan-in operators where you do not want to pay the cost of casting each element in a `map`.
|
||||||
*
|
*
|
||||||
* @tparam SuperOut a supertype to the type of element flowing out of the flow
|
* @tparam SuperOut a supertype to the type of element flowing out of the flow
|
||||||
* @return A flow that accepts `In` and outputs elements of the super type
|
* @return A flow that accepts `In` and outputs elements of the super type
|
||||||
|
|
@ -1721,7 +1721,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
* of closing these elements might get lost.
|
* of closing these elements might get lost.
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -1798,7 +1798,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -1856,7 +1856,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -2580,7 +2580,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2613,7 +2613,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2655,7 +2655,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2696,7 +2696,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -2741,7 +2741,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
|
|
@ -2777,7 +2777,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -2820,7 +2820,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2835,7 +2835,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2850,7 +2850,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2866,7 +2866,7 @@ final class Flow[In, Out, Mat](delegate: scaladsl.Flow[In, Out, Mat]) extends Gr
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@ object Source {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
||||||
* fan-in combinators where you do not want to pay the cost of casting each element in a `map`.
|
* fan-in operators where you do not want to pay the cost of casting each element in a `map`.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
|
|
@ -2256,7 +2256,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
* that key.
|
* that key.
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubSource]]. This means that after this combinator all transformations
|
* it is a [[SubSource]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -2314,7 +2314,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubSource]]. This means that after this combinator all transformations
|
* it is a [[SubSource]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -2359,7 +2359,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Flow]],
|
* The object returned from this method is not a normal [[Flow]],
|
||||||
* it is a [[SubSource]]. This means that after this combinator all transformations
|
* it is a [[SubSource]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -2601,7 +2601,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2634,7 +2634,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2676,7 +2676,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2717,7 +2717,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
|
|
@ -2753,7 +2753,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -2798,7 +2798,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -2841,7 +2841,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2856,7 +2856,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2871,7 +2871,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2887,7 +2887,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import scala.reflect.ClassTag
|
||||||
object SubFlow {
|
object SubFlow {
|
||||||
/**
|
/**
|
||||||
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
* Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
||||||
* fan-in combinators where you do not want to pay the cost of casting each element in a `map`.
|
* fan-in operators where you do not want to pay the cost of casting each element in a `map`.
|
||||||
*
|
*
|
||||||
* @tparam SuperOut a supertype to the type of element flowing out of the flow
|
* @tparam SuperOut a supertype to the type of element flowing out of the flow
|
||||||
* @return A flow that accepts `In` and outputs elements of the super type
|
* @return A flow that accepts `In` and outputs elements of the super type
|
||||||
|
|
@ -1697,7 +1697,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1730,7 +1730,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1772,7 +1772,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1813,7 +1813,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
|
|
@ -1849,7 +1849,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -1894,7 +1894,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -1937,7 +1937,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1952,7 +1952,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1967,7 +1967,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1983,7 +1983,7 @@ class SubFlow[In, Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Flow[I
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import scala.reflect.ClassTag
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
* * Upcast a stream of elements to a stream of supertypes of that element. Useful in combination with
|
||||||
* fan-in combinators where you do not want to pay the cost of casting each element in a `map`.
|
* fan-in operators where you do not want to pay the cost of casting each element in a `map`.
|
||||||
*/
|
*/
|
||||||
object SubSource {
|
object SubSource {
|
||||||
def upcast[U, T <: U, Mat](source: SubSource[T, Mat]): SubSource[U, Mat] = source.asInstanceOf[SubSource[U, Mat]]
|
def upcast[U, T <: U, Mat](source: SubSource[T, Mat]): SubSource[U, Mat] = source.asInstanceOf[SubSource[U, Mat]]
|
||||||
|
|
@ -1679,7 +1679,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1712,7 +1712,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1754,7 +1754,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -1795,7 +1795,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
|
|
@ -1831,7 +1831,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -1876,7 +1876,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -1919,7 +1919,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1934,7 +1934,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1949,7 +1949,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -1965,7 +1965,7 @@ class SubSource[Out, Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source[O
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
|
||||||
|
|
@ -1772,7 +1772,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
* of closing these elements might get lost.
|
* of closing these elements might get lost.
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -1860,7 +1860,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -1930,7 +1930,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
* }}}
|
* }}}
|
||||||
*
|
*
|
||||||
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
* The object returned from this method is not a normal [[Source]] or [[Flow]],
|
||||||
* it is a [[SubFlow]]. This means that after this combinator all transformations
|
* it is a [[SubFlow]]. This means that after this operator all transformations
|
||||||
* are applied to all encountered substreams in the same fashion. Substream mode
|
* are applied to all encountered substreams in the same fashion. Substream mode
|
||||||
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
* is exited either by closing the substream (i.e. connecting it to a [[Sink]])
|
||||||
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
* or by merging the substreams back together; see the `to` and `mergeBack` methods
|
||||||
|
|
@ -2095,7 +2095,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2127,7 +2127,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
* Sends elements downstream with speed limited to `elements/per`. In other words, this stage set the maximum rate
|
||||||
* for emitting messages. This combinator works for streams where all elements have the same cost or length.
|
* for emitting messages. This operator works for streams where all elements have the same cost or length.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
* Tokens drops into the bucket at a given rate and can be `spared` for later use up to bucket capacity
|
||||||
|
|
@ -2168,7 +2168,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size).
|
||||||
|
|
@ -2203,7 +2203,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
/**
|
/**
|
||||||
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
* Sends elements downstream with speed limited to `cost/per`. Cost is
|
||||||
* calculating for each element individually by calling `calculateCost` function.
|
* calculating for each element individually by calling `calculateCost` function.
|
||||||
* This combinator works for streams when elements have different cost(length).
|
* This operator works for streams when elements have different cost(length).
|
||||||
* Streams of `ByteString` for example.
|
* Streams of `ByteString` for example.
|
||||||
*
|
*
|
||||||
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
* Throttle implements the token bucket model. There is a bucket with a given token capacity (burst size or maximumBurst).
|
||||||
|
|
@ -2247,7 +2247,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval. throttleEven using
|
* This is a simplified version of throttle that spreads events evenly across the given time interval. throttleEven using
|
||||||
* best effort approach to meet throttle rate.
|
* best effort approach to meet throttle rate.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
@ -2262,7 +2262,7 @@ trait FlowOps[+Out, +Mat] {
|
||||||
/**
|
/**
|
||||||
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
* This is a simplified version of throttle that spreads events evenly across the given time interval.
|
||||||
*
|
*
|
||||||
* Use this combinator when you need just slow down a stream without worrying about exact amount
|
* Use this operator when you need just slow down a stream without worrying about exact amount
|
||||||
* of time between events.
|
* of time between events.
|
||||||
*
|
*
|
||||||
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
* If you want to be sure that no time interval has no more than specified number of events you need to use
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue