-
Notifications
You must be signed in to change notification settings - Fork 48
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(mpz-common): dummy executor #132
Conversation
async fn join<'a, A, B, RA, RB>(&'a mut self, a: A, b: B) -> (RA, RB) | ||
where | ||
A: for<'b> FnOnce(&'b mut Self) -> ScopedBoxFuture<'a, 'b, RA> + Send + 'a, | ||
B: for<'b> FnOnce(&'b mut Self) -> ScopedBoxFuture<'a, 'b, RB> + Send + 'a, | ||
RA: Send + 'a, | ||
RB: Send + 'a, | ||
{ | ||
let a = a(self).await; | ||
let b = b(self).await; | ||
(a, b) | ||
} | ||
|
||
async fn try_join<'a, A, B, RA, RB, E>(&'a mut self, a: A, b: B) -> Result<(RA, RB), E> | ||
where | ||
A: for<'b> FnOnce(&'b mut Self) -> ScopedBoxFuture<'a, 'b, Result<RA, E>> + Send + 'a, | ||
B: for<'b> FnOnce(&'b mut Self) -> ScopedBoxFuture<'a, 'b, Result<RB, E>> + Send + 'a, | ||
RA: Send + 'a, | ||
RB: Send + 'a, | ||
E: Send + 'a, | ||
{ | ||
let a = a(self).await?; | ||
let b = b(self).await?; | ||
Ok((a, b)) | ||
} |
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.
Shouldn't these be polled concurrently? Or doesn't it matter because it is only a dummy?
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.
Doesn't really matter, probably better to do it sequentially to catch any potential deadlocks
This PR adds a dummy executor that does nothing.