EventsSourcing-on-Azure-Functions icon indicating copy to clipboard operation
EventsSourcing-on-Azure-Functions copied to clipboard

Command attribute/binding

Open MerrionComputing opened this issue 6 years ago • 8 comments

Need to have a Command class which can be bound to a parameter on an Azure function with autoresolve properties for command name and unique identifier.

If the unique identifier is not set, use a GUID

This will create an event stream to use to orchestrate execution of the step(s) required to process the command.

MerrionComputing avatar Dec 16 '19 14:12 MerrionComputing

Needs to be on a per Domain basis so command handlers can be set up to watch a single domain.

MerrionComputing avatar Dec 18 '19 13:12 MerrionComputing

Each command is backed by an event stream

MerrionComputing avatar Dec 19 '19 10:12 MerrionComputing

The life cycle for a command should be something along the lines of:-

  • Creation

  • Parameter(s) set

  • Validations performed

  • Action step(s) performed

At any stage the current parameter(s), and the current progress of the command can be attained by running a projection over the command event stream.

MerrionComputing avatar Jan 03 '20 13:01 MerrionComputing

Projections required:-

  1. Command parameters - because parameters can be added or changed while the command is in flight (by the command handler itself usually) it is handy to be able to get the set of parameters as at a given point in time.

  2. Command state - is the command complete, in error, running etc.

MerrionComputing avatar Feb 18 '20 19:02 MerrionComputing

Question: should there be an explicit "Command Complete" event?

MerrionComputing avatar Feb 18 '20 19:02 MerrionComputing

Added a Command.GetExecutionState() method to get the current state of the command orchestration

MerrionComputing avatar Feb 18 '20 22:02 MerrionComputing

Needs a way to get the current state of a command from HTTP request

MerrionComputing avatar Jul 03 '21 09:07 MerrionComputing

Command functions

  • GetCommandState - Get the state of the given command instance
  • CancelCommand - cancel a command in progress (and issue any compensating actions)
  • ReissueCommand - re run a previously completed or cancelled command

MerrionComputing avatar Jul 14 '21 22:07 MerrionComputing