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

Iterator based subscription API (DEV-112) #252

Closed
wants to merge 2 commits into from

Conversation

hunter1703
Copy link

@hunter1703 hunter1703 commented Jul 19, 2023

Added : Subscription API similar to read API i.e. iteration based rather than callback based
Added : With new API, user code can now receive control messages like Checkpoint, CaughtUp (this new control message will be part of a separate PR and is the actual goal of DB-224) etc. from the subscription in addition to events

Example :

var subscription = client.SubscribeToAll(FromAll.Start);

await foreach (var message in subscription.Messages) {
    if (message is StreamMessage.Event eventMessage) {
        await eventAppeared(eventMessage.ResolvedEvent);
    } else if (message is StreamMessage.SubscriptionMessage.Checkpoint checkpointMessage) {
        await checkpointReached(checkpointMessage.Position);
    }
}

subscriptionDropped();

@linear
Copy link

linear bot commented Jul 19, 2023

@hunter1703 hunter1703 marked this pull request as draft July 19, 2023 09:53
@hunter1703 hunter1703 force-pushed the db-224-iteration-based-subscription-api branch from 5f295ba to 23ad802 Compare July 26, 2023 07:49
@hunter1703 hunter1703 force-pushed the db-224-iteration-based-subscription-api branch from fd3dbda to c82e4bc Compare July 26, 2023 09:08
@hunter1703 hunter1703 self-assigned this Jul 26, 2023
@hunter1703 hunter1703 marked this pull request as ready for review July 26, 2023 09:15
cdevarenne
cdevarenne previously approved these changes Aug 2, 2023
@timothycoleman timothycoleman changed the title Iterator based subscription API Iterator based subscription API (DEV-106) Aug 24, 2023
@linear
Copy link

linear bot commented Aug 24, 2023

@timothycoleman timothycoleman removed their request for review August 24, 2023 13:49
@alexeyzimarev alexeyzimarev changed the title Iterator based subscription API (DEV-106) Iterator based subscription API (DEV-112) Aug 29, 2023
@w1am w1am force-pushed the db-224-iteration-based-subscription-api branch 2 times, most recently from 21e014b to c82e4bc Compare January 8, 2024 11:20
@w1am w1am requested a review from RagingKore January 8, 2024 13:34
@RagingKore
Copy link
Contributor

Added to latest version.

@RagingKore RagingKore closed this Apr 25, 2024
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.

4 participants