Contents of Scheduler ("Time Machine")
- Link to State Manager
- Priority queue of events that need to be done
- Some algorithm to intelligently update nodes in a BFS manner
- Link to Network: Some events can't be handled locally and are sent to another process/machine.
The Process for updating: (not quite complete)
- NodeInstances are loaded into the StateManager?. (Most likely, it's already there. However, if the StateManager? stores these in a real database, some loading may need to be done.)
- StateManager? hands Schedule the relevant NodeInstances: The one for the node in question and his parents which will be read from.
- The Scheduler calls the appropriate op on the node in question. 'changed' if the parents have changed or 'clocked' if the node asked for a callback.
- The op is given the node's input and output ports, as well as stateaccess, which is a dict-like structure somewhat tied to the NodeInstance?. The op returns values to update the output ports. It may also be allowed to the output ports in the middle of the function, since we will be able to track both port reads and writes.
- The NodeInstance?, now updated, is given back to StateManager?, who stores the NodeInstance?.
- Repeat.