File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/distributed/coordinator Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ import (
1111 "time"
1212)
1313
14- // Responsible for listening to events
14+ const maxRate = 5 * time .Second
15+
16+ // DatabaseConsumer is a struct which is
17+ // responsible for listening to events
1518// that are being emitted throughtout the
1619// system and decide which ones to forward
1720// to the database manager
18-
19- const maxRate = 5 * time .Second
20-
2121type DatabaseConsumer struct {
2222 er EventRaiser // we can pass callback without this type knowing about how to publish events itself
2323
@@ -28,10 +28,10 @@ type DatabaseConsumer struct {
2828 sources []string
2929}
3030
31- // NewDataConsumer is a constructor function
31+ // NewDatabaseConsumer is a constructor function
3232// for DatabaseConsumer, using EventRaiser to
3333// add listners (Dependency Injection)
34- func NewDataConsumer (er EventRaiser ) * DatabaseConsumer {
34+ func NewDatabaseConsumer (er EventRaiser ) * DatabaseConsumer {
3535
3636 dc := DatabaseConsumer {
3737 er : er ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ func main() {
1212 // wiring event aggreagtor to coordinator package
1313 ea := coordinator .NewEventAggregator ()
1414 // instantiating package level databse consumer
15- dc : = coordinator .NewDataConsumer (ea )
15+ dc = coordinator .NewDatabaseConsumer (ea )
1616
1717 ql := coordinator .NewQueueListener (ea )
1818 go ql .ListenForNewSource ()
You can’t perform that action at this time.
0 commit comments