@@ -35,7 +35,8 @@ class PipelineWorker : public Nan::AsyncWorker {
3535 PipelineWorker (
3636 Nan::Callback *callback, PipelineBaton *baton, Nan::Callback *debuglog, Nan::Callback *queueListener,
3737 std::vector<v8::Local<v8::Object>> const buffersToPersist) :
38- Nan::AsyncWorker (callback), baton(baton), debuglog(debuglog), queueListener(queueListener),
38+ Nan::AsyncWorker (callback, " sharp:PipelineWorker" ),
39+ baton (baton), debuglog(debuglog), queueListener(queueListener),
3940 buffersToPersist (buffersToPersist) {
4041 // Protect Buffer objects from GC, keyed on index
4142 std::accumulate (buffersToPersist.begin (), buffersToPersist.end (), 0 ,
@@ -1014,18 +1015,18 @@ class PipelineWorker : public Nan::AsyncWorker {
10141015 std::string warning = sharp::VipsWarningPop ();
10151016 while (!warning.empty ()) {
10161017 v8::Local<v8::Value> message[1 ] = { New (warning).ToLocalChecked () };
1017- debuglog->Call (1 , message);
1018+ debuglog->Call (1 , message, async_resource );
10181019 warning = sharp::VipsWarningPop ();
10191020 }
10201021
10211022 // Decrement processing task counter
10221023 g_atomic_int_dec_and_test (&sharp::counterProcess);
10231024 v8::Local<v8::Value> queueLength[1 ] = { New<v8::Uint32>(sharp::counterQueue) };
1024- queueListener->Call (1 , queueLength);
1025+ queueListener->Call (1 , queueLength, async_resource );
10251026 delete queueListener;
10261027
10271028 // Return to JavaScript
1028- callback->Call (3 , argv);
1029+ callback->Call (3 , argv, async_resource );
10291030 }
10301031
10311032 private:
@@ -1302,5 +1303,6 @@ NAN_METHOD(pipeline) {
13021303 // Increment queued task counter
13031304 g_atomic_int_inc (&sharp::counterQueue);
13041305 v8::Local<v8::Value> queueLength[1 ] = { Nan::New<v8::Uint32>(sharp::counterQueue) };
1305- queueListener->Call (1 , queueLength);
1306+ v8::Local<v8::Object> recv = Nan::New<v8::Object>();
1307+ Nan::Call (*queueListener, recv, 1 , queueLength);
13061308}
0 commit comments