Skip to content

async_hooks: add AsyncResource.bindCurrent()

This new static method does roughly the same thing as AsyncResource.bind(), except that it does not create a new AsyncResource. Instead, it relies on the existing current one.

This is an optimization useful in basically any situation where bind() would be called without passing (or relying on) the type argument.

I opted to make a completely different method, rather than overload bind() even more than it already is, but I can change that if desired.

Merge request reports

Loading