You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a small issue with the latest version of async-wormhole. When you do not define a pre_post_poll handler for async wormhole it will throw an error like this one:
error[E0698]: type inside `async fn` body must be known in this context
--> lib/api/src/instance.rs:190:20
|
190 | let task = async_wormhole::AsyncWormhole::new(stack, |yielder| -> Result<Box<[crate::Val]>, RuntimeError> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `P`
|
note: the type is part of the `async fn` body because of this `await`
The easiest way to fix this is to just set an empty lambda function like so, but that's a little ugly.
task.set_pre_post_poll(|| {});
Maybe we can hide function this method feature flag or require the handler to always be set? I think the error might be super confusing for some users.
The text was updated successfully, but these errors were encountered:
Yay 🎉 !! I was always wondering if anyone outside the Lunatic project would use this. Would love to hear about your use case.
When you do not define a pre_post_poll handler for async wormhole it will throw an error like this one:
You are right! This is super bad DX, sorry about that. I was wondering for a long time what an elegant way would be to solve this, but never got around to test different approaches. Ideally it would be a zero-cost operation if you don't set a pre_post function.
A feature flag could be a good solution. If you would like to contribute this, I would be happy to review it.
(Yay, this seems to be the first issue :) )
I noticed a small issue with the latest version of
async-wormhole
. When you do not define a pre_post_poll handler for async wormhole it will throw an error like this one:The easiest way to fix this is to just set an empty lambda function like so, but that's a little ugly.
Maybe we can hide function this method feature flag or require the handler to always be set? I think the error might be super confusing for some users.
The text was updated successfully, but these errors were encountered: