Skip to content

changing default WorkerContext #327

@belm0

Description

@belm0

It would be nice to have a way to change the default WorkerContext, for example:

trio_parallel.set_default_context(WorkerContext(idle_timeout=math.inf))

I'd like to change the idle timeout globally. Currently, I'd have to open a worker context at the root nursery, and store that into a contextvar or something, and hope that everyone remembers to use that context.

The default parameters of WorkerContext are quite arbitrary, so I think it would make sense to have a way to change the default context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions