internal/agent/tools/mcp/init.go 🔗
@@ -129,7 +129,6 @@ func Close() error {
case <-done:
case <-time.After(5 * time.Second):
}
- broker.Shutdown()
return nil
}
Kujtim Hoxha created
internal/agent/tools/mcp/init.go | 1 -
internal/pubsub/broker.go | 20 --------------------
2 files changed, 21 deletions(-)
@@ -129,7 +129,6 @@ func Close() error {
case <-done:
case <-time.After(5 * time.Second):
}
- broker.Shutdown()
return nil
}
@@ -18,16 +18,6 @@ func NewBroker[T any]() *Broker[T] {
}
}
-// NewBrokerWithOptions creates a new broker (options ignored for compatibility).
-func NewBrokerWithOptions[T any](_, _ int) *Broker[T] {
- return NewBroker[T]()
-}
-
-// Shutdown removes all listeners.
-func (b *Broker[T]) Shutdown() {
- b.signal.Reset()
-}
-
// AddListener registers a callback for events.
func (b *Broker[T]) AddListener(key string, fn func(Event[T])) {
b.signal.AddListener(func(_ context.Context, event Event[T]) {
@@ -35,18 +25,8 @@ func (b *Broker[T]) AddListener(key string, fn func(Event[T])) {
}, key)
}
-// RemoveListener removes a listener by key.
-func (b *Broker[T]) RemoveListener(key string) {
- b.signal.RemoveListener(key)
-}
-
// Publish emits an event to all listeners without blocking.
func (b *Broker[T]) Publish(ctx context.Context, t EventType, payload T) {
event := Event[T]{Type: t, Payload: payload}
go b.signal.Emit(ctx, event)
}
-
-// Len returns the number of listeners.
-func (b *Broker[T]) Len() int {
- return b.signal.Len()
-}