Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Commit

Permalink
Ok but really poor performances
Browse files Browse the repository at this point in the history
  • Loading branch information
owulveryck committed Dec 12, 2015
1 parent 15e5a0d commit 81d7276
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion orchestrator/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (v *Graph) Run(stop <-chan time.Time) {
node := <-cs[i]
go func() {
for {
node.Wait <- m
node.Wait <- *v
l.Lock()
defer l.Unlock()
co.Wait()
Expand Down
6 changes: 3 additions & 3 deletions orchestrator/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package orchestrator

import (
"github.com/owulveryck/gorchestrator/structure"
"math/rand"
"time"
)
Expand All @@ -39,12 +38,13 @@ type Node struct {
// Run executes the artifact of a given node
func (n *Node) Run() <-chan Message {
c := make(chan Message)
waitForIt := make(chan structure.Matrix) // Shared between all messages.
waitForIt := make(chan Graph) // Shared between all messages.
go func() {
n.State = ToRun
for n.State <= ToRun {
c <- Message{n.ID, n.State, waitForIt}
m := <-waitForIt
g := <-waitForIt
m := g.Digraph
s := m.Dim()
n.State = Running
for i := 0; i < s; i++ {
Expand Down
3 changes: 1 addition & 2 deletions orchestrator/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ package orchestrator

import (
"encoding/json"
"github.com/owulveryck/gorchestrator/structure"
)

type Message struct {
ID int
State int
Wait chan structure.Matrix
Wait chan Graph
}

// Error is a type used when any error related to the input or node structure occurs
Expand Down

0 comments on commit 81d7276

Please sign in to comment.