irc
irc copied to clipboard
Make send and associated `send_*` functions async
We currently (upcoming 0.14) have a Sender which uses an unbounded channel for outgoing messages. This doesn't provide any back pressure to the send function in case we are unable to process the messages quickly enough, possibly leading to OOM conditions.
A fairly straight forward way to solve this would be to limit the buffer size of the channel (See buffer
indocumentation). This does mean that the sender needs to use send
and .await
over it as appropriate, requiring all send-related functions to be async
This would mean an impactful API overhaul, but it would in my view be worthwhile.