Skip to content

No Recursion Bayeux

Compare
Choose a tag to compare
@NickALafrance NickALafrance released this 06 Mar 22:51
· 12 commits to master since this release
53804af

The Bayeux client was using recursion to continually call the connect() function, which led to an infinitely growing function call stack and after a few days of that even the most robust server with deepest memory banks will give out.
This changes the bayeux client to a state pattern that allows each state to transition to another state, and the bayeux client, after being started, will just call handle() on its current state in a loop instead of recursively calling connect().

This does change up the order in which some things are occurring, even if all the same channels are called in the same order. Make sure to test your usage of the streaming client channels if you are subscribing|extending to any of the Meta channels.