Exemple #1
0
 public static Option <CommandSubmission> Submit(this ICommandPatternSystem CPS, ICommandSpec Command, SystemNode DstNode, CorrelationToken?ct)
 => CPS.Submit(array(Command), DstNode, ct).Map(x => x.FirstOrDefault());
Exemple #2
0
 /// <summary>
 /// Executes an arbitrary number of commands
 /// </summary>
 /// <param name="CPS">The command system</param>
 /// <param name="Commands">The command specifications to execute</param>
 /// <returns></returns>
 public static IEnumerable <IOption> ExecuteCommands(this ICommandPatternSystem CPS, params ICommandSpec[] Commands)
 => map(Commands, spec => CPS.ExecuteCommand(spec));
Exemple #3
0
 public static Option <CommandSubmission <TSpec> > Submit <TSpec>(this ICommandPatternSystem CPS, TSpec Command, SystemNode DstNode, CorrelationToken?ct)
     where TSpec : CommandSpec <TSpec>, new()
 => CPS.Submit(array(Command), DstNode, ct).Map(x => x.FirstOrDefault());
Exemple #4
0
 public static Option <int> SaveSpecs(this ICommandPatternSystem CPS, IEnumerable <ICommandSpec> Commands)
 => CPS.SaveSpecs(Commands.ToArray());
Exemple #5
0
 public CommandProcessor(ICommandPatternSystem CPS, int?BatchSize = null, bool?Concurrent = null)
 {
     this.CPS        = CPS;
     this.Concurrent = Concurrent ?? false;
     this.BatchSize  = BatchSize ?? 1;
 }
Exemple #6
0
 public static ICommandProcessor <TSpec, TPayload> Create <TSpec, TPayload>(ICommandPatternSystem CPS, int?BatchSize = null, bool?Concurrent = null)
     where TSpec : CommandSpec <TSpec, TPayload>, new()
 => new CommandProcessor <TSpec, TPayload>(CPS, BatchSize, Concurrent);
Exemple #7
0
 public static ICommandProcessor Create(ICommandPatternSystem CPS, int?BatchSize = null, bool?Concurrent = null)
 => new CommandProcessor(CPS, BatchSize, Concurrent);