This doesn't seem right to me. Assuming that we're only sending when we can't reach a node, trying to send from inside the gen_server like this is going to block the whole process which means messages piling up and timeouts in calls to get things like the buffered count.

It seems like the "proper" way for this to work would be to have a child process that makes the blocking call and returns when its successful at which point we fall back into this loop using a nosuspend/noconnect approach to drain the queue. When that returns false again we spawn the child process again.