Skip to content

Consensus Service

Compare
Choose a tag to compare
@narenranjit narenranjit released this 31 May 15:21
· 333 commits to master since this release

Bug Fixes:

  • World Service: getCurrentRunId and newRunForWorld calls were ignoring any files or cinFiles parameters passed in; they now correctly pass it through to the APIs, facilitating building multiplayer Vensim models relying on external files.
  • Fixed bug where the muliplayer strategy was prematurely returning a success before a run was actually created.

Improvements:

  • If you're using ngrok for testing your simulation locally, it is now identified as "local" (and defaults to using api.forio.com)

Features:

New DataService methods:

  • getChannel: returns a subscribable hook to the push channel. This is a convenience wrapper around the getDataChannel method of the ChannelManager
  • pushToArray: Adds items to an underlying array structure on a document. See REST API docs for details.

New Consensus Services

Two new (related) services have been added: F.service.Consensus and F.service.ConsensusGroup, as well as a helper worldservice.consensus() method.

The Consensus Service allows you to build common features in multiplayer games like:

  • Delaying execution of an operation until all users within a world have 'submitted'
  • Enforcing timed 'rounds' within the game
  • Providing the model with default values for users who haven't submitted

See documentation for Consensus Service and Consensus Group for more details.

Chores:

  • The build process has been switched from browserify to webpack. This should have no visible difference except a slightly smaller bundle size.
  • Now that ES6 usage is more common, parts of the codebase has been converted to ES6 and transpiled with Babel.