Guest User

Untitled

a guest
Dec 10th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.19 KB | None | 0 0
  1. // some async fn
  2. void read(Callback callback)
  3.  
  4. void callSync(alias asyncFn)()
  5. {
  6.     Waitable w;
  7.     asyncFunc(=> { w.notify() })
  8.     w.wait()
  9. }
  10.  
  11. // from within fiber
  12. callSync!read()
Add Comment
Please, Sign In to add comment