Skip to content

How to properly shutdown, mid-process, a multithreaded graph? #155

@DaveMtl

Description

@DaveMtl

Greetings,

First, great library, we are making a pyqt app to handle data processing and flowpipe has been immensely useful.

I'd like to know if you have any advices on how to properly stop an app while a graph is running in threading mode.

Right now we are getting the following exception:
raise RuntimeError('cannot schedule new futures after ' RuntimeError: cannot schedule new futures after interpreter shutdown

My first idea was to add a flag inside the _evaluate_threaded function to quit when set to True. But doing it this way doesn't allow my nodes to properly close and they might be working on writing a file which would corrupt it.

I could wait for the graph to end before quitting but some of our processes could take a long time and that wouldn't be great for the user. Or maybe I could broadcast a message to raise an exception in all nodes so they can quite gracefully.

I wonder if you have any advice on how to handle that.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions