Skip to content

Commit

Permalink
Create memory allocation for bus instance
Browse files Browse the repository at this point in the history
  • Loading branch information
maestre3d committed Apr 25, 2023
1 parent 2da78b0 commit c6dcfe7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ type Bus struct {
}

// NewBus allocates a Bus instance. Specify options to customize Publisher's default configurations.
func NewBus(w Writer, r Reader, options ...PublisherOption) Bus {
func NewBus(w Writer, r Reader, options ...PublisherOption) *Bus {
reg := make(EventRegistry)
return Bus{
return &Bus{
EventRegistry: reg,
Publisher: NewPublisher(w, reg, options...),
SubscriberScheduler: NewSubscriberScheduler(r, reg),
Expand Down
4 changes: 2 additions & 2 deletions bus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func TestBus(t *testing.T) {
t.Error(errStart)
return
}
}(&bus)
}(bus)
defer func(bus *streams.Bus) {
if errStop := bus.Shutdown(); errStop != nil {
t.Fatal(errStop)
}
}(&bus)
}(bus)
defer chanbuf.DefaultBus.Shutdown()
err := bus.Publish(context.TODO(), anyEvent{
ID: "123-foo",
Expand Down

0 comments on commit c6dcfe7

Please sign in to comment.