crodas / microredis

Redis server implemented in rust.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Internal improvement to Pub/Sub #19

Closed crodas closed 2 years ago

crodas commented 2 years ago

Instead of using Unbounded channels, add a cap for 1,000 messages in the buffer. When the buffer is full, messages will be dropped. For this to happen a connection in subscribe mode should have more than 1,000 other messages pending delivery. After that point, messages will be dropped to avoid using too much memory.

In general it is a bad practice to have unlimited buffers lying around in the codebase.