xaya / libxayagame

MIT License
21 stars 20 forks source link

Add waitforchange RPC method #27

Closed domob1812 closed 5 years ago

domob1812 commented 5 years ago

For front-ends, we should have a "long polling" RPC method that blocks until the current game state is updated. It could simply be waitforchange without any arguments and without returning anything. The front-end could then call that method, and once it returns, call another method to read the current data - like getcurrentstate, but it could also be a game-specific method that reads just data for the currently shown UI.

domob1812 commented 5 years ago

@RyuMaster, does that sound about right? I.e. no arguments and no result, just blocking the RPC call until the state has been updated?

domob1812 commented 5 years ago

Implemented and merged with #28.