-
Notifications
You must be signed in to change notification settings - Fork 265
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
feat: Provider::subscribe_logs
#339
Conversation
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.
lgtm, I would want Event::subscribe
too
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.
lgtm
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.
lgtm
pending @DaniPopes
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.
@DaniPopes can we somehow unify the usage of Subscription<T>
and PollChannel<T>
to have a single front-end that works for both polling and pubsub?
using channels should allow us to erase the type of the backing stream/coroutine
@prestwich I think so, but I feel that would complicate things quite a bit for not much benefit? |
it means that users would follow the same API regardless of provider and get automatically upgraded to pubsub subscriptions when they change endpoints (unless they specifically want to downgrade to polling for some reason) |
i agree w prestwich here, this would most likely also give us transport stacking back? although i'd leave that for a follow up since it's somewhat unrelated to this pr |
Self { sub, _phantom: PhantomData } | ||
} | ||
|
||
/// Converts the subscription into a stream. |
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 results in an unnameable type. Is there any situation in which a user would want to name the resulting stream?
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 guess we want a similar thing as SubscriptionStream
here with the type we decode on poll_next?
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.
ideally we have these all work the same way. can convert this to issue?
Regardless, that's not in scope for this PR. Opened #346 to capture. |
re-running CI before merge |
Motivation
Adds
Provider::subscribe_logs
andEvent::subscribe
methodsSolution
PR Checklist