Skip to content

Commit

Permalink
removed path parameter in network bus
Browse files Browse the repository at this point in the history
  • Loading branch information
stanipetrosyan committed May 8, 2024
1 parent 5307efc commit 4538ea2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions eventbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ type EventBus interface {
Channel(adress string) Channel
}

type DefaultEventBus struct {
type defaultEventBus struct {
channels map[string]Channel
}

func (e *DefaultEventBus) Channel(address string) Channel {
func (e *defaultEventBus) Channel(address string) Channel {
_, exists := e.channels[address]
if !exists {
e.channels[address] = NewChannel(address)
Expand All @@ -17,7 +17,7 @@ func (e *DefaultEventBus) Channel(address string) Channel {
}

func NewEventBus() EventBus {
return &DefaultEventBus{
return &defaultEventBus{
channels: map[string]Channel{},
}
}
2 changes: 1 addition & 1 deletion examples/networkbus/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var eventbus = goeventbus.NewEventBus()

func main() {

network := goeventbus.NewNetworkBus(eventbus, "localhost:9000", "/bus")
network := goeventbus.NewNetworkBus(eventbus, "localhost:9000")
eventbus.Channel("hello").Subscriber().Listen(func(context goeventbus.Context) {
printMessage(context.Result())
})
Expand Down
2 changes: 1 addition & 1 deletion examples/networkbus/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var eventbus = goeventbus.NewEventBus()

func main() {

network := goeventbus.NewNetworkBus(eventbus, "localhost:9000", "/bus")
network := goeventbus.NewNetworkBus(eventbus, "localhost:9000")
server := network.Server()
go server.Listen()

Expand Down
2 changes: 1 addition & 1 deletion network_bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type defaultNetworkBus struct {
address string
}

func NewNetworkBus(bus EventBus, address, path string) NetworkBus {
func NewNetworkBus(bus EventBus, address string) NetworkBus {
return defaultNetworkBus{localBus: bus, address: address}
}

Expand Down

0 comments on commit 4538ea2

Please sign in to comment.