Skip to content

Add contrib package for lambda workers#1408

Open
Sushisource wants to merge 6 commits intomainfrom
lambdaworker
Open

Add contrib package for lambda workers#1408
Sushisource wants to merge 6 commits intomainfrom
lambdaworker

Conversation

@Sushisource
Copy link
Copy Markdown
Member

@Sushisource Sushisource commented Apr 2, 2026

This is verified working in combination with this sample: temporalio/samples-python#286

At least one open design question I want to resolve before merging.

client_connect_config: LambdaClientConnectConfig = field(
default_factory=LambdaClientConnectConfig
)
worker_config: WorkerConfig = field(default_factory=WorkerConfig)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My main design question is about this. With this decision, we auto-reuse all the worker init parameters, which is good, but the syntax looks like:

config.worker_config["task_queue"] = "my_task_queue"

Which, the key literal does autocomplete, but it's maybe not as nice as duplicating some of the more common fields so we can have

config.task_queue = "my_task_queue"

The downside there is, of course, that they're duplicative of the same fields as keys on worker_config.

I think I prefer how it is now, since the keys still autocomplete, but would like to hear input.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't have a type like WorkerConfig for client connect. We probably should - I could add it in this PR but it would mean making changes to the main part of the SDK (albeit easy ones)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Feedback from SDK team: Let's stick with dict for now & add Client connection config class

@Sushisource Sushisource marked this pull request as ready for review April 3, 2026 00:53
@Sushisource Sushisource requested a review from a team as a code owner April 3, 2026 00:53
def run_worker(
version: WorkerDeploymentVersion,
configure: Callable[[LambdaWorkerConfig], None],
) -> Callable[[Any, Any], None]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume there's nothing better we can do on the types here because this is what the lambda handler expects?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We maybe could, but it'd involve taking a dep purely for that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm... And do they actually write code that interacts with those types, or it would just be for us?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It would be only for type verification

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