fivdi / epoll

A low-level Node.js binding for the Linux epoll API
MIT License
84 stars 13 forks source link

AsyncResource constructed at the incorrect time #28

Closed fivdi closed 6 years ago

fivdi commented 6 years ago

The AsyncResource required for a callback should be constructed when the callback is stored for later invocation. This allows the async context to be restored at the callback invocation time. Currently the AsyncResource is constructed at callback invocation time and doesn't restore the correct async context.

fivdi commented 6 years ago

Fixed with https://github.com/fivdi/epoll/commit/37395897d10cfdd10dfe71d2286d7bbf7584ec46 and published with epoll@2.0.2.