Closed Crazy-Duck closed 8 years ago
@jimmydorry could you elaborate on what you consider graceful handling of the above? I'd love to see your view on things before I start implementing further stuff
Will write up a more detailed response tomorrow, but basically i meant handling of GC restart events, connection drops (i.e. when you lose internet for a few seconds locally), and steam timeouts (i.e. patch tuesdays).
This was the last time I recall the issue cropping up. https://github.com/RJacksonm1/node-dota2/issues/105
I don't know how node-steam has changed (whether it now handles this), but your bot framework should consider handling connection states, especially around the GC restarts.
Alright, I added some basic keep alive code. Node-dota2 seems to handle GC disconnects on its own, so I focused on keeping the Steam connection alive (for which I based myself on how @howardchung uses the lib in yasp). It should now reconnect when it detects a dc. This leaves the problem of requests failing because they're sent while GC isn't ready. Since all communication with the GC is async anyways, I'm thinking about adding a job process queue. This queue would execute in FIFO all requests and retry (with exponential back-off) if one fails cause GC isn't ready. Thoughts?
Sounds awesome.
Queueing added. You pass a function to the bot and it will schedule it for execution as soon as the GC is available. If GC is unavailable the queue applies exponential backoff for retries
Wow, that is crazy useful.
Implement graceful handling of service interruptions