Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Implement a reflection-based aggregate system. #63

Merged
merged 11 commits into from
May 31, 2018
Merged

Conversation

jmalloc
Copy link
Owner

@jmalloc jmalloc commented May 26, 2018

This is a bit quick and dirty, but I think it addresses everything important in #10.

@codecov-io
Copy link

codecov-io commented May 26, 2018

Codecov Report

Merging #63 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #63   +/-   ##
=======================================
  Coverage   46.06%   46.06%           
=======================================
  Files          39       39           
  Lines        1396     1396           
=======================================
  Hits          643      643           
  Misses        743      743           
  Partials       10       10

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 a7bd5e2...24121e2. Read the comment docs.

@jmalloc
Copy link
Owner Author

jmalloc commented May 26, 2018

I should probably add a check in the "recorder" that panics if you try to record an event that you haven't defined a handler for.

@jmalloc
Copy link
Owner Author

jmalloc commented May 26, 2018

FYI guys I've also attempted a basic banking transfer workflow example in the transfer-workflow. That branch is based on this one, so it uses the reflect-based API for the aggregates, and a hand-rolled saga to implement the workflow.

return ax.MessageType{}, false
}

// isCommandHandler returns the message that is handled by rt, if it is a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be isEventHandler.

// isCommandHandler returns the

Also the line below should be event handlers instead of command handlers.

// It is called when a "trigger" message is received and there is no
// existing saga instance. env contains the "trigger" message.
//
// If err is nil, id must be a valid InstanceID, and d must be non-nil.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no d?

// fn is a pointer to a function variable that describes the signature to match.
// It is assigned the generated function.
//
// It returns the types that that are supported by the generated type-switch.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that that

@jmalloc jmalloc merged commit 67adc59 into master May 31, 2018
@jmalloc jmalloc deleted the 10-aggregates branch May 31, 2018 00:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants