Hello Arnout,
We are providing api for developers to use. So, there is a callback written
by other developers which will be executed instead of Thread.sleep in
example.
Hence, we cannot say whether they will write CPU intensive code or some
kind of IO.
Hope this helps.
On Wednesday,
You should be able to allow a faster upstream to continue, while emitting
the latest value whenever downstream is read with conflate like so:
Source(0 to 1000)
.throttle(10, 1.second, 1, ThrottleMode.shaping) // fast upstream
.conflate((in, prev) => in) // keep the latest value
Hello Saloni,
I think it would be helpful to have a more realistic example than doing
"Thread.sleep(1000)" in the sink.
Could we unpack what this sleep is intended to mimic in your 'real'
application? Is it for example doing CPU-intensive data parsing or perhaps
some kind of IO?
Kind regards,
Hello,
We are having a requirement that if a consumer is slower than producer then
discard all the elements that cannot be consumed and whenever the consumer
gets ready, feed the latest element from producer.
We tried an approach as follows:
Source.actorRef(0, OverflowStrategy.dropHead)