Why bother writing similar code twice for blocking and async code?
When implementing both sync and async versions of API in a crate, most API
of the two version are almost the same except for some async/await keyword.
amphi
provides a macro to get blocking code from async implementation for free,
alongside with the async code.
amphi is an English prefix meaning both
. This crate copy the async code and strip all
async/await keyword to get a blocking implementation.
- place all your async code in a mod. By default, the mod should call
amphi
, but it can be customize. - apply
amphi
attribute macro on the mod declaration code.
MIT