Closed trustmaster closed 10 years ago
Eventually this method has been implemented:
Graph.Stop()
It stops a running network by stopping its processes and subnets, but without closing any connections. It makes it possible to stop and replace some parts of network without closing channels and having to recreate and reconnect everything. Also it lets some unfinished tasks to be finished normally.
Currently the networks are shut down with the downstream flow: closing an input of a process makes it close its outputs (after it finishes processing current data), closing inputs for the downstream process and so on until all processes in the network are stopped.
Some networks don't have input ports, they are started with IIPs and continue running until the application receives termination signal. Or in some cases the network has to be shut down as soon as possible without knowing about its inputs.
So, 2 new methods are proposed:
Graph.Stop()
to shut the network down gracefully.Graph.Kill()
to terminate it urgently loosing all data that is still inside the network.I also have a suspicion that the current "downstream shutdown" strategy might cause races in complex graphs with multiple merging branches. So this should be studied and probably alternative strategies should be considered.