iex> Spear.stream!(conn, "$ce-Spear.Test", chunk_size: 3) |> Enum.take(3)
[
%Spear.Event{..}, # event 0 in category, 0 in stream
%Spear.Event{..}, # event 1 in category, 0 in stream
%Spear.Event{..} # event 2 in category, 0 in stream
]
iex> event = List.last(v())
%Spear.Event{..} # event 2, 0 in stream
iex> Spear.stream!(conn, "$ce-Spear.Test", chunk_size: 2, from: event) |> Enum.take(2)
[
%Spear.Event{..}, # event 0 in category, 0 in stream
%Spear.Event{..}, # event 1 in category, 0 in stream
]
Because it would read the Spear.Event.metadata.revision field as 0 and think that was the revision of the projected stream.
This PR stores the link information from the read_resp in Spear.Event.metadata.link and uses it as the revision/position info for read requests (including subscriptions)
closes #32
before this PR on machine:
Because it would read the
Spear.Event.metadata.revision
field as0
and think that was the revision of the projected stream.This PR stores the link information from the read_resp in
Spear.Event.metadata.link
and uses it as the revision/position info for read requests (including subscriptions)