Skip to content

Commit

Permalink
Correct actions channel in container backend
Browse files Browse the repository at this point in the history
  • Loading branch information
atosatto committed Jul 25, 2016
1 parent c065501 commit 6f99741
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion container/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

type Backend interface {
Monitor(eventsChan chan<- event.Event, errChan chan<- error)
Exec(actionsChan chan<- action.Action, errChan chan<- error)
Exec(actionsChan <-chan action.Action, errChan chan<- error)
}

func NewBackend(name string, c config.BackendConfig) (Backend, error) {
Expand Down
2 changes: 1 addition & 1 deletion container/backend/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ func (d *Docker) Monitor(eventsChan chan<- kevent.Event, errChan chan<- error) {
}
}

func (d *Docker) Exec(actionsChan chan<- kaction.Action, errChan chan<- error) {
func (d *Docker) Exec(actionsChan <-chan kaction.Action, errChan chan<- error) {
log.Debug("[Docker][Exec] Start")
}
12 changes: 6 additions & 6 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package engine
import (
log "github.com/Sirupsen/logrus"
"github.com/opsfactory/kappa/container/action"
"github.com/opsfactory/kappa/container/backend"
containerBackend "github.com/opsfactory/kappa/container/backend"
"github.com/opsfactory/kappa/container/event"
)

type Engine struct {
backend backend.Backend
containerBackend containerBackend.Backend
}

func NewEngine(b backend.Backend) *Engine {
return &Engine{backend: b}
func NewEngine(b containerBackend.Backend) *Engine {
return &Engine{containerBackend: b}
}

func (e Engine) Run() error {
Expand All @@ -21,8 +21,8 @@ func (e Engine) Run() error {
eventsChan := make(chan event.Event)
actionsChan := make(chan action.Action)

go e.backend.Monitor(eventsChan, errChan)
go e.backend.Exec(actionsChan, errChan)
go e.containerBackend.Monitor(eventsChan, errChan)
go e.containerBackend.Exec(actionsChan, errChan)
go e.handleEvent(eventsChan, actionsChan, errChan)

for err := range errChan {
Expand Down

0 comments on commit 6f99741

Please sign in to comment.