<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node.git/src/async-wrap.h, branch master</title>
<subtitle>github.com: joyent/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/'/>
<entry>
<title>async-wrap: add event hooks</title>
<updated>2014-12-05T13:00:45+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-20T19:27:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=709fc160e5204f9a926c2867a8ee77e55d6c30aa'/>
<id>709fc160e5204f9a926c2867a8ee77e55d6c30aa</id>
<content type='text'>
Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run.

**If any of these callbacks throws an exception, there is no forgiveness
or recovery. A message will be displayed and a core file dumped.**

Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.

Here are a few notes on how to make the hooks work:

- The "this" of all event hook callbacks is the request object.

- The zero field (kCallInitHook) of the flags object passed to
  setupHooks() must be set != 0 before the init callback will be called.

- kCallInitHook only affects the calling of the init callback. If the
  request object has been run through the create callback it will always
  run the before/after callbacks. Regardless of kCallInitHook.

- In the init callback the property "_asyncQueue" must be attached to
  the request object. e.g.

  function initHook() {
    this._asyncQueue = {};
  }

- DO NOT inspect the properties of the object in the init callback.
  Since the object is in the middle of being instantiated there are some
  cases when a getter is not complete, and doing so will cause Node to
  crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Call a user-defined callback at specific points in the lifetime of an
asynchronous event. Which are on instantiation, just before/after the
callback has been run.

**If any of these callbacks throws an exception, there is no forgiveness
or recovery. A message will be displayed and a core file dumped.**

Currently these only tie into AsyncWrap, meaning no call to a hook
callback will be made for timers or process.nextTick() events. Though
those will be added in a future commit.

Here are a few notes on how to make the hooks work:

- The "this" of all event hook callbacks is the request object.

- The zero field (kCallInitHook) of the flags object passed to
  setupHooks() must be set != 0 before the init callback will be called.

- kCallInitHook only affects the calling of the init callback. If the
  request object has been run through the create callback it will always
  run the before/after callbacks. Regardless of kCallInitHook.

- In the init callback the property "_asyncQueue" must be attached to
  the request object. e.g.

  function initHook() {
    this._asyncQueue = {};
  }

- DO NOT inspect the properties of the object in the init callback.
  Since the object is in the middle of being instantiated there are some
  cases when a getter is not complete, and doing so will cause Node to
  crash.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>async-wrap: explicitly pass parent</title>
<updated>2014-12-05T12:57:01+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-17T20:54:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=419f18d2e245405b839e7441e5f59bc08e9c8d6c'/>
<id>419f18d2e245405b839e7441e5f59bc08e9c8d6c</id>
<content type='text'>
When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.

Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. This adds ~80ns
to instantiation time.

A future optimization would be to add the v8::External as the data field
when creating the v8::FunctionTemplate, change the pointer just before
making the call then NULL'ing it out afterwards. This adds enough code
complexity that it will not be attempted until the current approach
demonstrates it is a bottle neck.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When instantiating a new AsyncWrap allow the parent AsyncWrap to be
passed. This is useful for cases like TCP incoming connections, so the
connection can be tied to the server receiving the connection.

Because the current architecture instantiates the *Wrap inside a
v8::FunctionCallback, the parent pointer is currently wrapped inside a
new v8::External every time and passed as an argument. This adds ~80ns
to instantiation time.

A future optimization would be to add the v8::External as the data field
when creating the v8::FunctionTemplate, change the pointer just before
making the call then NULL'ing it out afterwards. This adds enough code
complexity that it will not be attempted until the current approach
demonstrates it is a bottle neck.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>async-wrap: expose async-wrap as binding</title>
<updated>2014-12-05T12:56:45+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-15T00:15:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=1293f0a228a3a01863896c82f6734aaaf93bd16b'/>
<id>1293f0a228a3a01863896c82f6734aaaf93bd16b</id>
<content type='text'>
Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
only the PROVIDER types are exposed. This is a preliminary step before
more functionality is added.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: all wrap's now use actual FunctionTemplate</title>
<updated>2014-12-05T12:52:42+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-08-26T19:21:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=5962dbef49ae6dccc98004b6b955c34336ccbbf5'/>
<id>5962dbef49ae6dccc98004b6b955c34336ccbbf5</id>
<content type='text'>
Instead of simply creating a new v8::Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.

Additionally, the "provider" argument in the ReqWrap constructor is no
longer optional.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of simply creating a new v8::Object to contain the connection
information, instantiate a new instance of a FunctionTemplate. This will
allow future improvements for debugging and performance probes.

Additionally, the "provider" argument in the ReqWrap constructor is no
longer optional.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>node, async-wrap: remove MakeDomainCallback</title>
<updated>2014-12-05T12:37:53+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-13T00:08:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=42df679c458b3edc2d4754baaf3b16ba015a1dd6'/>
<id>42df679c458b3edc2d4754baaf3b16ba015a1dd6</id>
<content type='text'>
C++ won't deoptimize like JS if specific conditional branches are
sporadically met in the future. Combined with the amount of code
duplication removal and simplified maintenance complexity, it makes more
sense to merge MakeCallback and MakeDomainCallback.

Additionally, type casting in V8 before verifying what that type is will
cause V8 to abort in debug mode if that type isn't what was expected.
Fix this by first checking the v8::Value before casting.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C++ won't deoptimize like JS if specific conditional branches are
sporadically met in the future. Combined with the amount of code
duplication removal and simplified maintenance complexity, it makes more
sense to merge MakeCallback and MakeDomainCallback.

Additionally, type casting in V8 before verifying what that type is will
cause V8 to abort in debug mode if that type isn't what was expected.
Fix this by first checking the v8::Value before casting.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>async-wrap: move MakeCallback to .cc</title>
<updated>2014-12-05T12:35:44+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-12T23:58:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=2593c1413155a42604c53327b9c2b23b017f0dfa'/>
<id>2593c1413155a42604c53327b9c2b23b017f0dfa</id>
<content type='text'>
MakeCallback is too large a function to be inlined. Likewise, only
having header files will not allow for any part of AsyncWrap to be
exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MakeCallback is too large a function to be inlined. Likewise, only
having header files will not allow for any part of AsyncWrap to be
exposed cleanly via NODE_MODULE_CONTEXT_AWARE_BUILTIN().

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: remove Async Listener</title>
<updated>2014-12-05T12:33:26+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-11-12T00:48:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=b6559553a42b05ad793e1ea755e252b230be6212'/>
<id>b6559553a42b05ad793e1ea755e252b230be6212</id>
<content type='text'>
Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Async Listener was the name of the user-facing JS API, and is being
completely removed. Instead low level hooks directly into the mechanism
that AL used will be introduced in a future commit.

PR-URL: https://github.com/joyent/node/pull/8110
Signed-off-by: Trevor Norris &lt;trev.norris@gmail.com&gt;
Reviewed-by: Fedor Indutny &lt;fedor@indutny.com&gt;
Reviewed-by: Alexis Campailla &lt;alexis@janeasystems.com&gt;
Reviewed-by: Julien Gilli &lt;julien.gilli@joyent.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: introduce lookupService function</title>
<updated>2014-06-27T00:02:19+00:00</updated>
<author>
<name>Saúl Ibarra Corretgé</name>
<email>saghul@gmail.com</email>
</author>
<published>2014-06-20T22:43:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=35b9580cd84452dd76aa19715479a47074d1761b'/>
<id>35b9580cd84452dd76aa19715479a47074d1761b</id>
<content type='text'>
Uses getnameinfo to resolve an address an port into a hostname and
service.

Signed-off-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Uses getnameinfo to resolve an address an port into a hostname and
service.

Signed-off-by: Fedor Indutny &lt;fedor@indutny.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>async_wrap: add provider types/pass to constructor</title>
<updated>2014-02-05T21:30:56+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-01-20T21:33:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=4a9af3fecb4baf677f265e2e6e34a674a53810a6'/>
<id>4a9af3fecb4baf677f265e2e6e34a674a53810a6</id>
<content type='text'>
These will be used to allow users to filter for which types of calls
they wish their callbacks to run.

Signed-off-by: Timothy J Fontaine &lt;tjfontaine@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These will be used to allow users to filter for which types of calls
they wish their callbacks to run.

Signed-off-by: Timothy J Fontaine &lt;tjfontaine@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>async_wrap/timers: remove Add/RemoveAsyncListener</title>
<updated>2014-01-21T18:20:07+00:00</updated>
<author>
<name>Trevor Norris</name>
<email>trev.norris@gmail.com</email>
</author>
<published>2014-01-20T21:20:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node.git/commit/?id=63ccfc35366774fff1ee8db313a1b9ea6d6eb66c'/>
<id>63ccfc35366774fff1ee8db313a1b9ea6d6eb66c</id>
<content type='text'>
The ability to add/remove an AsyncListener to an object after its
creation was an artifact of trying to get AL working with the domain
module. Now that is no longer necessary and other features are going to
be implemented that would be affected by this functionality. So the code
will be removed for now to simplify the implementation process.

In the future this code will likely be reintroduced, but after some
other more important matters have been addressed.

None of this functionality was documented, as is was meant specifically
for domain specific implementation work arounds.

Signed-off-by: Timothy J Fontaine &lt;tjfontaine@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ability to add/remove an AsyncListener to an object after its
creation was an artifact of trying to get AL working with the domain
module. Now that is no longer necessary and other features are going to
be implemented that would be affected by this functionality. So the code
will be removed for now to simplify the implementation process.

In the future this code will likely be reintroduced, but after some
other more important matters have been addressed.

None of this functionality was documented, as is was meant specifically
for domain specific implementation work arounds.

Signed-off-by: Timothy J Fontaine &lt;tjfontaine@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
