Skip to content

Create try-with wrapper to temporarily provide context to python entrypoints #200

Open
@bjester

Description

@bjester

If this was where the context issue was originating from then it probably has to do with removing the worker reference from this utility in combination with using some non-RemoteListenableWorker workers. Since the non-RemoteListenableWorker workers would be started by the system, we wouldn't necessarily have access to the foreground service. Storing static instances of the worker is bad, not only for the reasons regarding the context, but also because multiple instances could be running at once, so you don't necessarily get the instance you expect.

An alternative would be to go back to having all workers be RemoteListenableWorkers. Or use a sort of context manager approach in the worker such that this utility returns that context when called within that block

Originally posted by @bjester in #199 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions