-
Notifications
You must be signed in to change notification settings - Fork 8
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
programmatic async function creation #43
Comments
|
Right, I was looking exactly for something analogous to As an aside, I don't mean to suggest |
The tricky part is that These calls are a bit tricky, see I agree a |
It would be nice to programmatically create an async function, such as when you want to convert an expression into an anonymous function.
An example interface could be:
as_async_function( { await(foo) } )
At the moment we can only pass anonymous functions to
coro::async
because of the substitute call incoro::: assert_lambda
. Technically I could usecoro:::generator0(fn, type = "async")
, but it seems it's not exported for a reason.You can get half of the way with
rlang::inject
, but it's a bit hacky and you can't use it to set the formals of the anonymous function.The text was updated successfully, but these errors were encountered: