Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs have no mention of the type registry #5

Open
delaneyj opened this issue Sep 21, 2015 · 2 comments
Open

Docs have no mention of the type registry #5

delaneyj opened this issue Sep 21, 2015 · 2 comments

Comments

@delaneyj
Copy link

The README.md is missing how the type registry integrates, the docs no longer match the examples.

@marconi
Copy link
Contributor

marconi commented Nov 26, 2015

@andrewwebber 👍 on this, also its confusing regarding .Get of EventRepository. Couchbase only accepts a single param called id while Rethinkdb accepts id and typeRegistry. I think the latter is right since when loading from storage you need to resolve those event types.

@marconi
Copy link
Contributor

marconi commented Nov 26, 2015

Update:

Made it work for now by passing typeRegistry to my EventStreamRepository then from .Get I simply call the stored typeRegistry property.

Another thing I noticed is that registered events dont get match when retrieving handlers, had to do something like:

eventValue := reflect.New(eventType)
e := eventValue.Interface()
...
vevent := cqrs.VersionedEvent{
    ID: event.ID,
    ...
    Event: reflect.Indirect(reflect.ValueOf(e)).Interface(),
}

If I just store e directly its a pointer and so reflected type doesn't match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants