public async Task Process(BatchConfig batch, BatchOption option) { foreach (var command in batch.Commands) { if (command is TargetCommand targetCommand) { if (option == BatchOption.ApplyCurrentState) { await ITargetProcessor.ApplyCurrentStateAsync(targetCommand); } else if (option == BatchOption.ResetState) { await ITargetProcessor.ResetState(targetCommand); } else { await ITargetProcessor.Process(targetCommand); } } else if (command is OkCommand) { await IOkProcessor.Process(command as OkCommand); } } }
public Task Init(ITargetProcessor <TInput> processor) { _processor = processor; _initialized = true; return(TaskDone.Done); }
public Task Init(ITargetProcessor <TInput> processor) { this._processor = processor; return(TaskDone.Done); }
public Task Init(ITargetProcessor <TInput> processor) { this._processor = processor; return(Task.CompletedTask); }