Hi all,

Looking at the source of BroadcastHub, I notice two things:

* When the last consumer cancels, the hub drops its buffer (quite
intentionally, from a comment in the source code, "This feature is quite
handy.")
* When there are no consumers, the hub demands and fills its buffers.

I don't know what the reasoning behind the above behaviours are, but they
seem contradictory - why drop the buffer if you're just going to fill it up
again?

I do agree with the handiness of dropping the buffer, and would definitely
like that feature for my use cases, but I'd also like to see the buffer
kept empty - so, the hub won't pull unless there is at least one consumer,
and, if it receives a push when there are no consumers (as a result of an
outstanding pull from when there were consumers), it will grab and drop the
element, without pulling again.

In my case I'm using a Flow.backpressureTimeout on the incoming flow, and I
don't want to have to wait for the broadcast hubs buffer to be filled
before the timeout is triggered.

If there's agreement that the buffer should be kept empty while there's no
consumers, then I'll be happy to submit a PR.

Cheers,

James

-- 
*James Roper*
*Software Engineer*

REACTIVE SUMMIT 2017
------------------------------
MICROSERVICES. FAST DATA PIPELINES. DISTRIBUTED SYSTEMS.
Austin (TX) - October 18-20, 2017
EARLY BIRD TICKETS - REGISTER BY 7/31
<http://www.reactivesummit.org/registration?utm_source=email&utm_medium=email-signature&utm_campaign=EVT-2017-OCT-Reactive-Summit-Austin&utm_term=none&utm_content=none>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to