Rethink the hook API #364
Labels
A-core
Area: Core / deadpool
enhancement
New feature or request
quality of life
Improvements to the API resulting in a better quality of life for the users of deadpool.
Working with hooks is somewhat annoying. It gets worse when mixing it with sync code. See:
#363 (reply in thread)
Rather than using a
closure
API it might actually make sense to move to atrait
API like that:That would also allow writing reuseable hooks in a more concise way:
Also the separation between
async_fn
andsync_fn
was done to allow for some optimizations that makes it possible to skip any extra allocations needed because of boxed futures. As it turns outsync_fn
sounds a lot like it allows blocking code to be written while it's actually just meant for code that doesn't need to callawait
.The text was updated successfully, but these errors were encountered: