Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): Adds domain implementation of AsyncContextStrategy #7767

Merged
merged 7 commits into from Apr 6, 2023

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Apr 5, 2023

This PR adds setDomainAsyncContextStrategy to the Node SDK which when called enables a domain based async strategy.

This required adding and exporting ensureHubOnCarrier from core which ensures the async context starts off with a base hub copied from the global hub. To move this code outside of core, both hasHubOnCarrier and API_VERSION would need to be exported.

I also removed the pass-through of ...args: A[]) in runWithAsyncContext and simplified the types since there is no need to pass them through. We only need to pass the references so they can be added to the domain.

There are some tests adapted from the previous domain tests that suggest that it functions as it should.

@timfish timfish mentioned this pull request Apr 5, 2023
9 tasks
@timfish timfish marked this pull request as ready for review April 6, 2023 12:19
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) April 6, 2023 12:27
@AbhiPrasad AbhiPrasad merged commit e741dd1 into getsentry:develop Apr 6, 2023
58 checks passed
@timfish timfish deleted the feat/domain-strategy branch April 6, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants