Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Use async hooks from node, fix route comment#53

Merged
omirho merged 1 commit into
masterfrom
node-route
Sep 2, 2021
Merged

Use async hooks from node, fix route comment#53
omirho merged 1 commit into
masterfrom
node-route

Conversation

@omirho

@omirho omirho commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

Fixes #24.

@omirho omirho requested a review from balachandr March 3, 2021 22:34
@balachandr

Copy link
Copy Markdown
Contributor

@aabmass for review.

@aabmass

aabmass commented Mar 9, 2021

Copy link
Copy Markdown
Member

I'm not super familiar with async hooks, but code makes sense to me. @omirho, were you able to verify it's working manually?

@lkonya

lkonya commented Apr 10, 2021

Copy link
Copy Markdown

Based on NodeJS docs, they suggest to use AsyncLocalStorage, rather than creating your own implementation on top async-hooks. Though this is only available from 12.17.
node-execution-context has an implementation to use AsyncLocalStorage when it is available or fall back to use async-hook if not.
Just thought worth mentioning it.

@omirho omirho merged commit 0427da3 into master Sep 2, 2021
@omirho omirho deleted the node-route branch September 2, 2021 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Express middleware can write the wrong route

4 participants