MerrionComputing / EventsSourcing-on-Azure-Functions

A library to demonstrate doing Event Sourcing as a data persistence mechanism for Azure Functions
MIT License
102 stars 20 forks source link

Command attribute/binding #24

Open MerrionComputing opened 4 years ago

MerrionComputing commented 4 years ago

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 commented 4 years ago

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

MerrionComputing commented 4 years ago

Each command is backed by an event stream

MerrionComputing commented 4 years ago

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

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 commented 4 years ago

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 commented 4 years ago

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

MerrionComputing commented 4 years ago

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

MerrionComputing commented 3 years ago

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

MerrionComputing commented 3 years ago

Command functions