On Sat, Apr 18, 2020 at 6:50 PM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
On 19/04/20 5:02 am, Antoine Pitrou wrote:
* How hard would it be, in the current implementation, to add buffering to channels?
* In the same vein, I think channels should allow adding readiness callbacks
Of these, I think the callbacks are more fundamental. If you have a non-buffered channel with readiness callbacks, you can implement a buffered channel on top of it.
Some questions: * Do you think it is worth adding readiness callbacks if we already have channel buffering? * Would a low-level channel implementation based on callbacks or locks be better (simpler, faster, etc.) than one based on buffering? * Would readiness callbacks in the high-level API be more or less user-friendly than alternatives: optional blocking, a lock, etc.? FWIW, I tend to find callbacks a greater source of complexity than alternatives. Thanks! -eric