fractalide/fractalide — pull request #78 by dmichiels (2014-10-19 21:18:55+00:00)
Title: Newhalt

fix #63

This PR allows to stop gracefully components.

Each component had the default input port : 'HALT'. When an IP is received in this port, the component will halt. As it is at the IPs level, the component must have ended is previous execution (in fact, respect all the condition for a new execution). So this procedure will not stop the current execution.
The component can do specify a special action before halting by creating the 'HALT' port, like clean a socket. An example is show in the displayHalt.oz component.

At the creation of a sub-component, a virtual input port 'HALT' is binded to all the 'HALT' inside port. That allows to shutdown a subcomponent.

The component 'halt.oz' let the user stop a graph. As the components know their "mother sub-component", it is possible to send an IP to the virtual 'HALT' port.

Also, creating a "supervisor" for halting the graph is possible by creating a special halt component.