daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // some async fn
  2. void read(Callback callback)
  3.  
  4. void callAsyncFnFromFiber(alias asyncFn)()
  5. {
  6.     auto thisFiber = getThisFiber()
  7.     asyncFunc(=> { thisFiber.resume() })
  8.     thisFiber.yield()
  9. }
  10.  
  11. // from within fiber
  12. callAsyncFromFiber!read()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top