Class: Engine
Defined in: | lib/Engine.coffee |
Overview
The Engine handles how and in which order to execute operations and add operations to the HistoryBuffer.
Instance Method Summary
- # (void) parseOperation(json) Parses an operatio from the json format.
- # (void) applyOpsBundle(ops_json) Apply a set of operations.
- # (void) applyOpsCheckDouble(ops_json) Same as applyOps but operations that are already in the HB are not applied.
- # (void) applyOps(ops_json) Apply a set of operations.
- # (void) applyOp(op_json) Apply an operation that you received from another peer.
- # (void) tryUnprocessed() Call this method when you applied a new operation.
Constructor Details
#
(void)
constructor(HB, parser)
Instance Method Details
#
(void)
parseOperation(json)
Parses an operatio from the json format. It uses the specified parser in your OperationType module.
#
(void)
applyOpsBundle(ops_json)
Apply a set of operations. E.g. the operations you received from another users HB.toJson().
#
(void)
applyOpsCheckDouble(ops_json)
Same as applyOps but operations that are already in the HB are not applied.
#
(void)
applyOps(ops_json)
Apply a set of operations. (Helper for using applyOp on Arrays)
#
(void)
applyOp(op_json)
Apply an operation that you received from another peer.
#
(void)
tryUnprocessed()
Call this method when you applied a new operation. It checks if operations that were previously not executable are now executable.