Skip to content

Conversation

@djgrant
Copy link
Contributor

@djgrant djgrant commented Mar 14, 2025

Workflows are invoked once per process so we can easily expose the context to any code running in that process.

import { getContext } from '@yieldstar/bun-worker-invoker';

function makeRequestUtil() {
  const context = getContext();
  const authToken = context.get('token');
  ...
}

@djgrant djgrant merged commit 5a7fe83 into main Mar 14, 2025
@djgrant djgrant deleted the context-singleton branch March 14, 2025 08:06
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.

2 participants