Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // some async fn
- void read(Callback callback)
- void callAsyncFnFromFiber(alias asyncFn)()
- {
- auto thisFiber = getThisFiber()
- asyncFunc(=> { thisFiber.resume() })
- thisFiber.yield()
- }
- // from within fiber
- callAsyncFromFiber!read()
Add Comment
Please, Sign In to add comment