testing channels and goroutines.
[goDBhammer.git] / src / benchcontroller.go
1 // the benchmark controller
2
3 package benchcontroller
4
5 import (
6         //"./dbconnector";
7         "os";
8         "time";
9 )
10
11 type BenchControllerConfig struct {
12         id int;
13 }
14
15 func CreateController()(contConfig *BenchControllerConfig)
16 {
17         bcConfig := new(BenchControllerConfig);
18         
19         return bcConfig;
20 }
21
22 func MainLoop(conf *BenchControllerConfig, commInChan chan int, commOutChan chan int)
23 {
24         for {
25                 time.Sleep(1000000000);
26                 i := <-commInChan;
27                 os.Stdout.WriteString("got a coms\n");
28                 commOutChan <- i;
29                 os.Stdout.WriteString("Send some back\n");
30         }
31 }