-
Notifications
You must be signed in to change notification settings - Fork 129
ReadStreamHeadPosition/Version #391
ReadStreamHeadPosition/Version #391
Conversation
… results should be.
…paste mistakes, debugged failing tests and implemented fixes
c16d742 to
c7496ea
Compare
| { | ||
| GuardAgainstDisposed(); | ||
|
|
||
| return (await ReadStreamBackwards(streamId, StreamVersion.End, 1, false, cancellationToken)).LastStreamPosition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this could be solved in a more optimized way for the http provider, please show me how.
| { | ||
| GuardAgainstDisposed(); | ||
|
|
||
| return (await ReadStreamBackwards(streamId, StreamVersion.End, 1, false, cancellationToken)).LastStreamVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this could be solved in a more optimized way for the http provider, please show me how.
| @@ -280,13 +281,63 @@ protected override async Task<long> ReadHeadPositionInternal(CancellationToken c | |||
|
|
|||
| if(result == DBNull.Value) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left this in - but the test for the new operations seem to suggest this path will never be hit (since result is either null or a value, not DBNull.Value). Similar remark in other relational store implementations.
This PR introduces two new methods on
IReadonlyStreamStore(non-breaking change):ReadStreamHeadPosition: reads the head position of a stream, i.e. the position of its last messageReadStreamHeadVersion: reads the head version of a stream, i.e. the version of its last messageThe test suite was extended with additional acceptance tests to cover the behavior of these new operations. This is the basis for a follow-up PR (in that it will follow a similar pattern) which will introduce support for reading the stream head message as well as the all stream head message.