Skip to content

Commit

Permalink
feat(core): Make runWithAsyncContext public API (#7817)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad authored Apr 12, 2023
1 parent 0e20bb5 commit a5c0430
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,11 @@ export function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefin
}

/**
* @private Private API with no semver guarantees!
* Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.
*
* Runs the supplied callback in its own async context.
* @param callback The callback to run in its own async context
* @param options Options to pass to the async context strategy
* @returns The result of the callback
*/
export function runWithAsyncContext<T>(callback: (hub: Hub) => T, options: RunWithAsyncContextOptions = {}): T {
const registry = getMainCarrier();
Expand Down

0 comments on commit a5c0430

Please sign in to comment.