Permalink
Browse files

Clean up stuff after import from SciPipe

  • Loading branch information...
samuell committed Jul 5, 2016
1 parent 584d620 commit 0ceac069b57f50f66170222baddb43ba26ff2cd3
Showing with 11 additions and 23 deletions.
  1. +8 −19 pipeline.go
  2. +0 −1 process.go
  3. +3 −3 sink.go
View
@@ -38,25 +38,14 @@ func (pl *PipelineRunner) Run() {
Error.Println("PipelineRunner: The PipelineRunner is empty. Did you forget to add the processes to it?")
os.Exit(1)
}
everythingConnected := true
for _, proc := range pl.processes {
if !proc.IsConnected() {
everythingConnected = false
}
}
if !everythingConnected {
Error.Println("PipelineRunner: Pipeline shutting down, since not all ports are connected!")
os.Exit(1)
} else {
for i, proc := range pl.processes {
Debug.Printf("PipelineRunner: Looping over process %d: %v ...\n", i, proc)
if i < len(pl.processes)-1 {
Debug.Printf("PipelineRunner: Starting process %d in new go-routine: %v\n", i, proc)
go proc.Run()
} else {
Debug.Printf("PipelineRunner: Starting process %d: in main go-routine: %v\n", i, proc)
proc.Run()
}
for i, proc := range pl.processes {
Debug.Printf("PipelineRunner: Looping over process %d: %v ...\n", i, proc)
if i < len(pl.processes)-1 {
Debug.Printf("PipelineRunner: Starting process %d in new go-routine: %v\n", i, proc)
go proc.Run()
} else {
Debug.Printf("PipelineRunner: Starting process %d: in main go-routine: %v\n", i, proc)
proc.Run()
}
}
}
View
@@ -2,6 +2,5 @@ package flowbase
// Base interface for all processes
type Process interface {
IsConnected() bool
Run()
}
View
@@ -2,17 +2,17 @@ package flowbase
type Sink struct {
Process
inPorts []chan interface{}
inPorts []chan *interface{}
}
// Instantiate a Sink component
func NewSink() (s *Sink) {
return &Sink{
inPorts: make([]chan interface{}, BUFSIZE),
inPorts: make([]chan *interface{}, BUFSIZE),
}
}
func (proc *Sink) Connect(ch chan interface{}) {
func (proc *Sink) Connect(ch chan *interface{}) {
proc.inPorts = append(proc.inPorts, ch)
}

0 comments on commit 0ceac06

Please sign in to comment.