private ReplicatedContent Operation(CoreReplicatedContent tx) { lock (this) { return(new DistributedOperation(tx, _globalSession, new LocalOperationId(0, _sequenceNumber++))); } }
private long HandleOperations(long commandIndex, IList <DistributedOperation> operations) { using (CommandDispatcher dispatcher = _coreState.commandDispatcher()) { foreach (DistributedOperation operation in operations) { if (!_sessionTracker.validateOperation(operation.GlobalSession(), operation.OperationId())) { _sessionTracker.validateOperation(operation.GlobalSession(), operation.OperationId()); commandIndex++; continue; } CoreReplicatedContent command = ( CoreReplicatedContent )operation.Content(); command.Dispatch(dispatcher, commandIndex, result => _progressTracker.trackResult(operation, result)); _sessionTracker.update(operation.GlobalSession(), operation.OperationId(), commandIndex); commandIndex++; } } return(commandIndex - 1); }