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

Add version expectancy support to Append command #7

Open
hecrj opened this issue Apr 7, 2015 · 2 comments
Open

Add version expectancy support to Append command #7

hecrj opened this issue Apr 7, 2015 · 2 comments
Assignees
Milestone

Comments

@hecrj
Copy link
Contributor

hecrj commented Apr 7, 2015

What about something like this?

tasks.try { tasks.append.by_id(task_id).expecting_version(3).call(events) }

I guess that the expecting_version method should be exposed by the Append command, as it only makes sense there, right? Should we rename the command to Create to make it consistent with other adapters?

@hecrj hecrj self-assigned this Apr 7, 2015
@hecrj hecrj added this to the 0.1.0 milestone Apr 7, 2015
@solnic
Copy link
Member

solnic commented Apr 7, 2015

I'd vote for renaming it to Create to make it consistent. Re expecting_version I've no idea what it does :)

@hecrj
Copy link
Contributor Author

hecrj commented Apr 7, 2015

I'll rename it then :D

Re expecting_version When you are adding new events to a stream you can specify the version in which you expect the stream to be. Normally, this version is the event number of the last event you've read from the stream. Thus, if between reading and writing someone has added some more events, your write will fail (actually, it could pass if the events that collide had the same uuids).

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

2 participants