-
Notifications
You must be signed in to change notification settings - Fork 14
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
implement subscription, acks & nacks in persistent subscriptions API #24
Conversation
Persistent.read_req_options( | ||
stream_identifier: Shared.stream_identifier(streamName: stream_name), | ||
group_name: group_name, | ||
buffer_size: opts[:buffer_size], |
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.
with EventStore 20+ you control the in-flight buffer in the connect...
function
in the tcp client this was a setting on the psub itself. this seems like a nice improvement because you might have multiple consumers some which can batch-process more events at once than others based on available resources
messages = | ||
if request.rpc.request_stream? and request.rpc.response_stream? do | ||
message_buffer | ||
else | ||
[:eof | message_buffer] | ||
end |
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.
this is the important part of the change to the connection: making sure to never send :eof
(which ends the request stream) for a bi-directional stream rpc like persistent.Read
rpc Read (stream ReadReq) returns (stream ReadResp);
this finishes off the persistent subscriptions API
connects #7
in conjunction with #23
was about as complicated as I assumed it'd be: needed to add a bit to Spear.Connection to allow bi-direction streaming
pretty nice to be able to reuse
Spear.cancel_subscription/3
for psubs as well. it works because the cancel mechanism is viaMint.HTTP2.cancel_request/2
which just sends a GOAWAY frame that tells the server this request is done and don't send any more data on or receive any more data from this request stream