diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-09-24 14:12:11 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-10-31 14:17:51 -0700 |
commit | efa62fd9cc817434206d9fd8592b7bbeaa240e9c (patch) | |
tree | d3385ab0c74b20fab8d4e53cfa8408dafec69492 /src/pipe_wrap.cc | |
parent | 21fbbd579080bab569c66100471a4c7b462bb0d6 (diff) | |
download | node-new-efa62fd9cc817434206d9fd8592b7bbeaa240e9c.tar.gz |
node: add AsyncListener support
AsyncListener is a JS API that works in tandem with the AsyncWrap class
to allow the user to be alerted to key events in the life cycle of an
asynchronous event. The AsyncWrap class has its own MakeCallback
implementation that core will be migrated to use, and uses state sharing
techniques to allow quicker communication between JS and C++ whether the
async event callbacks need to be called.
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r-- | src/pipe_wrap.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 08ab7190bd..a4e4ed1237 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -192,11 +192,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) { }; if (status != 0) { - MakeCallback(env, - pipe_wrap->object(), - env->onconnection_string(), - ARRAY_SIZE(argv), - argv); + pipe_wrap->MakeCallback(env->onconnection_string(), ARRAY_SIZE(argv), argv); return; } @@ -212,11 +208,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) { // Successful accept. Call the onconnection callback in JavaScript land. argv[1] = client_obj; - MakeCallback(env, - pipe_wrap->object(), - env->onconnection_string(), - ARRAY_SIZE(argv), - argv); + pipe_wrap->MakeCallback(env->onconnection_string(), ARRAY_SIZE(argv), argv); } // TODO(bnoordhuis) Maybe share this with TCPWrap? @@ -251,11 +243,7 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) { Boolean::New(writable) }; - MakeCallback(env, - req_wrap_obj, - env->oncomplete_string(), - ARRAY_SIZE(argv), - argv); + req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv); delete req_wrap; } |