Add send_async
method to AgentLink
so it's easier to work with futures
#1210
Labels
feature-request
A feature request
Is your feature request related to a problem? Please describe.
When having to call async functions inside of agent methods like
update
andhandle_input
an future closure is needed (with e.g.wasm-bindgen-futures
)Describe the solution you'd like
An convenience wrapper like
send_async
that takes an async closure and handles execution would be handyDescribe alternatives you've considered
Allowing some of the Agent trait methods to be async (with e.g.
async-trait
) might be an alternative but would come with added complexity to handle cases of lingering awaitsAdditional context
The case where an
send_async
closure calls the AgentLink after it was dropped would cause a panic, so this might be something to be consideredSimilarly
send_future
previously existed on components but was removed. Maybe an feature flag for such helper methods might be the right choice.Related: #1209
IssueHunt Summary
Backers (Total: $0.00)
Become a backer now!
Or submit a pull request to get the deposits!
Tips
The text was updated successfully, but these errors were encountered: