Skip to content

Adds API support for detecting server timeouts#12

Open
nugget wants to merge 2 commits intoalaingilbert:masterfrom
nugget:nugget/timeout-hook
Open

Adds API support for detecting server timeouts#12
nugget wants to merge 2 commits intoalaingilbert:masterfrom
nugget:nugget/timeout-hook

Conversation

@nugget
Copy link
Contributor

@nugget nugget commented Nov 14, 2021

I'm having a problem recently where my bots will stop seeing updates from the server, but don't realize they are disconnected. This PR adds a new callback hook OnTimeout to the API which will watch the internal lastActivity timestamp and emit a callback if no activity has been seen recently. Also adds a helper GetTimeoutInfo method to the API to allow code to inspect and evaluate current heartbeat and activity data.

I tried to match your code style as best I could. Happy to tweak or make adjustments if you think there's a cleaner way to implement this.

Adds new callback hook `OnTimeout` to the API which will watch the
internal `lastActivity` timestamp and emit a callback if no activity has
been seen recently.

Also adds a helper `GetTimeoutInfo` method to the API to allow code to
inspect and evaluate current heartbeat and activity data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant