jmalloc / ax

A message-driven application toolkit for Go. [EXPERIMENTAL]
MIT License
9 stars 3 forks source link

Allow Ax commands to trigger workflow methods #138

Closed danilvpetrov closed 6 years ago

danilvpetrov commented 6 years ago

This PR is to allow triggering WF methods with Ax commands as a addition to the existing event triggering.

danilvpetrov commented 6 years ago

Added more changes as per yesterday's discussion to modify prefixes for command and event handlers both for workflows and aggregates. Modified comments and docs to reflect the new changes, changed banking example to work with new prefixes, tested banking example: everything is working fine.

The summary of changes are as follows:

1. Aggregates

Command handlers now must start with 'Do' As before, all event handlers must start with 'When'.

1. Workflows

Workflow-triggering handlers now must start with 'Begin'. This works both for commands and events. Non-triggering command handlers now must start with 'Do' As before, all event handlers must start with 'When'; however, for workflow-triggering event handlers a combined prefix 'BeginWhen' must be added.

codecov-io commented 6 years ago

Codecov Report

Merging #138 into master will decrease coverage by 0.48%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
- Coverage   31.14%   30.66%   -0.49%     
==========================================
  Files          72       72              
  Lines        2530     2570      +40     
==========================================
  Hits          788      788              
- Misses       1718     1758      +40     
  Partials       24       24
Impacted Files Coverage Δ
src/ax/saga/aggregate.go 0% <ø> (ø) :arrow_up:
src/ax/saga/workflow.go 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b2dcf51...1cd0e64. Read the comment docs.