plafer / Tissue.jl

Framework for building computational graphs that process any real time data source.
https://plafer.github.io/Tissue.jl/stable/
MIT License
2 stars 1 forks source link

Make graph states explicit #17

Open plafer opened 3 years ago

plafer commented 3 years ago

A graph can be in 3 different states: READY, RUNNING, or STOPPING.

  1. when a graph is just created, its state is READY
  2. after start() is called, the graph moves in RUNNING state
  3. when stop() is called, or the source returns nothing, the graph moves in STOPPING state, until wait_until_done() is called and returns, after which it goes back into READY state

Note that wait_until_done() also does cleanup, and must be called before starting the graph again.

We can also expose a get_state(graph) which returns the current state, if ever someone needs it.

Preferably we implement #10 before this one.