Skip to content

Commit 40895a4

Browse files
Correctly instantiated DatabaseConsumer
1 parent b233d35 commit 40895a4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/distributed/coordinator/databaseconsumer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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-
2121
type 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,

src/distributed/coordinator/exec/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)