Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartbeat event #264

Closed
inad9300 opened this issue Sep 25, 2020 · 4 comments
Closed

Heartbeat event #264

inad9300 opened this issue Sep 25, 2020 · 4 comments

Comments

@inad9300
Copy link

Is there a way to listen to heartbeats from the client side? Something like onHeartbeat()... If not, would it be possible to add it?

@inad9300
Copy link
Author

Alternatively, the ability to send a heartbeat ("X") from the client would also be useful for my case – does this happen to be possible?

@jfarcand
Copy link
Member

jfarcand commented Oct 1, 2020

@inad9300 Yes it is doable. Take a look at

} else if (isString && _heartbeatPadding === _response.responseBody) {
// reset the internal reconnect counter, when we received also heartbeat message from server
_requestCount = 0;
continue;
}
. You can probably add the onHeartbeat() there. If you can try it and do a pull request I can integrate it. Thanks

@inad9300
Copy link
Author

inad9300 commented Oct 3, 2020

Based on my experiences with Atmosphere (both front and back ends), I have decided to move away from it in favor of Spring WebSockets, so if nobody else seems to need this feature, lets not bloat anymore the framework.

I have, nevertheless, out of curiosity, had a look at the source code. In particular, I passed it through TypeScript's compiler, and found a number of improvements and potential bugs that I summarized in #265.

If you expect people to contribute in the future, I recommend you add automated testing to the project, as well as type safety and modules. Otherwise, modifying a 3400+ lines source file full of legacy code for a project used by thousands is just too risky.

@jfarcand
Copy link
Member

jfarcand commented Oct 5, 2020

Thank for the pull request :-) Atmosphere is maintained but I avoid making drastic changes...agree with you on the test, lint, etc...just don't have the cycle :-)

@jfarcand jfarcand closed this as completed Oct 5, 2020
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

No branches or pull requests

2 participants