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

fix(job): make ctx and env binding to Job instances to use in handle() #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mileszim
Copy link

@mileszim mileszim commented Oct 1, 2023

This makes the env and ctx params available to Job instances. Resolves #56

);
}

async function handleQueueMessage(message: Message, ctx: ExecutionContext) {
async function handleQueueMessage<Env>(message: Message, ctx: ExecutionContext, env: Env) {
const instance = await hydrateInstanceFromQueuePayload(
message.body as MessagePayload
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to pass ctx and env here as second or third args, since that function is responsible for hydrating an instance. (even if we only end up assigning it for Job instances). Thoughts?

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.

Accessing ENV in Job
2 participants