testing channels and goroutines.
[goDBhammer.git] / src / benchcontroller.go
index e69de29..579edcb 100644 (file)
@@ -0,0 +1,31 @@
+// the benchmark controller
+
+package benchcontroller
+
+import (
+       //"./dbconnector";
+       "os";
+       "time";
+)
+
+type BenchControllerConfig struct {
+       id int;
+}
+
+func CreateController()(contConfig *BenchControllerConfig)
+{
+       bcConfig := new(BenchControllerConfig);
+       
+       return bcConfig;
+}
+
+func MainLoop(conf *BenchControllerConfig, commInChan chan int, commOutChan chan int)
+{
+       for {
+               time.Sleep(1000000000);
+               i := <-commInChan;
+               os.Stdout.WriteString("got a coms\n");
+               commOutChan <- i;
+               os.Stdout.WriteString("Send some back\n");
+       }
+}
\ No newline at end of file