Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some indentation so code fits nicely in slides

  • Loading branch information...
commit 4f1d8065abb081ee69cb850e22764ca5b76e659d 1 parent d78d5a5
@nikhilm authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 async/main.cc
View
13 async/main.cc
@@ -93,7 +93,8 @@ class Inventory : public ObjectWrap {
baton->callback = Persistent<Function>::New(cb);
baton->wrapper = wrapper;
- uv_queue_work(Loop(), &baton->request, ReshelveAsync, ReshelveAsyncAfter);
+ uv_queue_work(Loop(), &baton->request,
+ ReshelveAsync, ReshelveAsyncAfter);
return Undefined();
}
@@ -101,16 +102,20 @@ class Inventory : public ObjectWrap {
static void ReshelveAsync(uv_work_t *req) {
// This runs in a separate thread
// NO V8 interaction should be done
- ReshelveBaton *baton = static_cast<ReshelveBaton*>(req->data);
+ ReshelveBaton *baton =
+ static_cast<ReshelveBaton*>(req->data);
// if you want to modify baton values
// do synchronous work here
baton->wrapper->inv->reshelve();
}
static void ReshelveAsyncAfter(uv_work_t *req) {
- ReshelveBaton *baton = static_cast<ReshelveBaton*>(req->data);
+ ReshelveBaton *baton =
+ static_cast<ReshelveBaton*>(req->data);
+
Handle<Value> argv[] = { Null() }; // no error
- baton->callback->Call(Context::GetCurrent()->Global(), 1, argv);
+ baton->callback->Call(Context::GetCurrent()->Global(),
+ 1, argv);
baton->callback.Dispose();
delete baton;
Please sign in to comment.
Something went wrong with that request. Please try again.