Skip to content

Instantly share code, notes, and snippets.

@piscis
Created October 21, 2011 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piscis/1303926 to your computer and use it in GitHub Desktop.
Save piscis/1303926 to your computer and use it in GitHub Desktop.
Async Call
#define ASYNC_CALL(func, callback, ...) \
FSReqWrap* req_wrap = new FSReqWrap(); \
int r = uv_fs_##func(uv_default_loop(), &req_wrap->req_, \
__VA_ARGS__, After); \
assert(r == 0); \
req_wrap->object_->Set(oncomplete_sym, callback); \
req_wrap->Dispatched(); \
return scope.Close(req_wrap->object_);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment