summaryrefslogtreecommitdiff
path: root/manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'manager.go')
-rw-r--r--manager.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/manager.go b/manager.go
deleted file mode 100644
index d3d38fd..0000000
--- a/manager.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package main
-
-import (
- "fmt"
- "sync"
-
- "github.com/Shugyousha/stasher/filter"
- "github.com/Shugyousha/stasher/input"
- "github.com/Shugyousha/stasher/output"
- "github.com/Shugyousha/stasher/work"
-)
-
-type Manager struct {
- Input input.Input
- Filter filter.Filter
- Output output.Output
-}
-
-func (m *Manager) Run() {
- var wg sync.WaitGroup
-
- ic := m.Input.Start()
- for w := range ic {
- if w.Err != nil {
- fmt.Printf("Got an error when getting Work input: %q\n", w.Err)
- continue
- }
- wg.Add(1)
-
- go func(w *work.Work) {
- nw := m.Filter.Filter(w)
- err := nw.Error()
- if err != nil {
- fmt.Printf("Got an error when filtering Work: %q\n", err)
- }
- err = m.Output.Output(nw)
- if err != nil {
- fmt.Printf("Got an error when outputting Work: %q\n", err)
- }
-
- wg.Done()
- }(w)
- }
-
- wg.Wait()
-}