Sender-side deleting pending messages in mpsc channel

351 Views Asked by At

Please is there a way for sender to delete pending messages sent to mpsc channel (or crossbeam-channel or equivalent) which have not been consumed by the receiver yet? Something like sender.deleteAllPending().

1

There are 1 best solutions below

0
Denys Séguret On BEST ANSWER

You can't do that with mspc which is "single consumer".

With crossbeam, you can have multiple receivers. So you can clone and keep a receiver "sender side", so you can drain it.