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

Simplify event stream #36

Merged
merged 5 commits into from
Nov 1, 2017
Merged

Simplify event stream #36

merged 5 commits into from
Nov 1, 2017

Conversation

tomasaschan
Copy link
Owner

@tomasaschan tomasaschan commented Nov 1, 2017

The most disruptive change here is to revert the rename of IEventStore to IEventStream; I found it to be confusing that we have an IEventStream that can then query the store for events across multiple streams... Thus, the interface (and its implementations) are now called IEventStore and I intend to keep it that way.

It might make sense to create an abstraction at some point that is something like this:

public interface IEventStream<TEvent, TEventMetadata>
{
    Task<IEnumerable<TEvent>> Events(Func<IQueryable<TEventMetadata>, IQueryable<TEventMetadata>> query);

    Task Append(long versionBefore, IEnumerable<object> payloads);
}    

and add a method to the event store that gets you one, like

public interface IEventStore<TStreamId, TEvent, TEventMetadata>
{
    // current members...

    IEventStream<TEvent, TEventMetadata> GetStream(TStreamId streamId);
}

where the implementation is basically just a wrapper around the store and the stream identifer.

@tomasaschan tomasaschan merged commit 81238d3 into master Nov 1, 2017
@tomasaschan tomasaschan deleted the simplify-event-stream branch November 1, 2017 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant