socketio / socket.io-client-java

Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.
https://socketio.github.io/socket.io-client-java/installation.html
Other
5.31k stars 969 forks source link

sendBuffer should be accessible #750

Open SwathingBlock opened 1 year ago

SwathingBlock commented 1 year ago

The sendBuffer has a few issues.

  1. The buffer is essentially unlimited, so any message emited will ultimately be put on this buffer, meaning that it will potentially have a ridiculous amount of events. Ideally there should be a way to define a limit to this buffer with a FIFO policy.
  2. Buffer limit aside, there should be a way to clear this buffer, there are use cases where the user may need to implement his own queue because the queue on the Socket is too simple of an implementation, in which case the user may want to a short lived buffer by using the existing socket buffer but this queue may need to be cleared after a certain amount of time based on the user requirements.