The spec states that we "SHOULD constrain queue sizes to a runtime-configurable limit". In libzmq, the default is 1000, so that seemed like a sensible choice. Side note, there was a TODO to allow for "per subscriber hwm". The zmq docs are a bit vague in some places but it seems like it's supposed to be per-socket rather than per-subscriber.
This allows us to use Go's buffered channels instead of Queue.
Per-subscriber queues:
Currently, the pub socket maintains a single outbound queue, which can cause issues (e.g. what happens if a single connection hangs?)
Instead, we can spawn a goroutine for each Conn added. This also address this TODO.
Hey! I'm a fan of this library. A couple of tweaks:
Queue
.Conn
added. This also address this TODO.