-
Notifications
You must be signed in to change notification settings - Fork 13
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: seaprate blocking methods #72
Conversation
@@ -142,21 +142,13 @@ impl Client { | |||
/// when fully processed by the relay. | |||
/// Note: This function is experimental and will likely be removed in the |
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.
Is it still experimental?
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.
We haven't thought about it, but we've changed the API a couple of times already. So yeah, I'd consider it experimental still.
) -> ResponseFuture<BatchSubscribe> { | ||
let (request, response) = create_request(BatchSubscribe { | ||
) -> impl Future< | ||
Output = Result< |
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.
A bit ugly, I would use a type alias for this. clippy
should have noticed this 🤔
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.
Why isn't the function just async
?
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.
Making the function async
would capture self
reference for the lifetime of that future, which I wanted to avoid initially. Now why would I want to avoid capturing self
is another question. Maybe in the initial implementation there were some methods that required &mut self
, so I didn't want to mix immutable and mutable borrowing, not sure. But yeah, now that the client API is stable-ish, we could just convert these methods to be async
and return anonymous futures.
}) | ||
.await | ||
) -> Result< | ||
Vec<Result<SubscriptionId, Error<rpc::SubscriptionError>>>, |
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.
Why return SubscriptionId
still? Maybe change to ()
?
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 doesn't hurt to have in the future if needed
Description
This creates a separate
irn_subscribeBlocking
andirn_batchSubscribeBlocking
methods which were previously behind theblock
flag in the main method payloads.Also removes the requirement to pass subscription IDs to unsubscribe.
How Has This Been Tested?
Relay integration.
Due Diligence