cascades-fbp / cascades

Language-agnostic Flow-based Programming (FBP) framework in Go
MIT License
62 stars 8 forks source link

The network shuts down but the scheduler does not exit #9

Closed oleksandr closed 9 years ago

oleksandr commented 9 years ago

This network:

'/some/folder' -> DIR Walk(fs/walk) FILE -> Debug(core/console)
Walk ERR -> Errors(core/console)

Lists all files in the /some/folder and then shuts down (starting from DIR port of Walk). All components exist but the bin/cascades program is still hanging.

Expected: all sub processes and the main process to exit.

oleksandr commented 9 years ago

`func (self *Runtime) Start() has a separate Goroutine for every running process. When the process exits. For now fixing it will be:

if !ps.cmd.ProcessState.Success() || len(self.processes) == 0 {
    self.Shutdown()
}

we exit when component process exits with an error or no running processes left.