2:26 PM
- For socket liveliness you should be clearer un your naming, it is confusing. liveUpdatedSockets contains non-live sockets? so it contains all? but hy is it useful, and why name it as such?
you'll need an always up-to-date list of live sockets at some point. It's not very clean to filter them every time in
getLiveSocket
-
ack
: why do you only wait ack on checker thread, why not on every single message? that would allow more responsiveness
Anyway, all you said is what your code told me, except socket.isLive() which I thought was doing something but is just returning a stored boolean
I think you should lift your pen a bit, a think about interaction between your objects, and their responsibilites.
for example, why would a Socket not manage itself? ping itself every 60s, manage a queue of input messages, etc ?
also sockets can have much better info than the manager class about themselves. They could wait for ack on their own business messages, and delay pinging (a business message is also a ping if it receives an ack!)
manager classes are a form of god-object, which increase complexity, reduce reusabilty and rewrittability
For example, having a singleton would be fine, to handle a unique pinger thread. Unnecessary, but fine.
but i don't see the point of SendToQueue being a singleton at all. In fact, i don't see why it should have an instance in the first place.
now static methods acting solely through other Objects means the method should be written over there.
« first day (2 days earlier) next day → last day (27 days later) »