MCPcopy Create free account
hub / github.com/nodejs/nan / AfterDelay

Function AfterDelay

test/cpp/asyncresource.cpp:37–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void AfterDelay(uv_work_t* req, int status) {
38 HandleScope scope;
39
40 DelayRequest *delay_request = static_cast<DelayRequest*>(req->data);
41 v8::Local<v8::Function> callback = New(delay_request->callback);
42
43 v8::Local<v8::Object> target = New<v8::Object>();
44
45 // Run the callback in the async context.
46 delay_request->runInAsyncScope(target, callback, 0, NULL);
47
48 delete delay_request;
49}
50
51NAN_METHOD(Delay) {
52 int delay = To<int>(info[0]).FromJust();

Callers

nothing calls this directly

Calls 2

runInAsyncScopeMethod · 0.80
NewFunction · 0.50

Tested by

no test coverage detected