Skip to content

Should the pyodide runner start a new worker for each session? #31

@christianp

Description

@christianp

Python code can change stuff in imported packages, and that persists between sessions. The example we have is that the lecturer reassigned sys.stdout but forgot to put it back. So it looked like subsequent runs weren't producing any output.

The only reliably way that we can think of to be sure that the Python environment is "fresh" at the start of each session would be to make a new worker object that loads pyodide from scratch. There's an issue pyodide/pyodide#703 about this.

The downside is that it takes a long time.

Also, we'd have to make sure to destroy each worker after use so that we don't use too much memory.

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