message-bus
message-bus copied to clipboard
修复 Unsubscribe 方法中的回调比较逻辑,确保正确关闭队列并返回适当的错误信息
This pull request improves the unsubscribe logic in the messageBus by making handler matching more precise and providing clearer error reporting when unsubscribing from a topic.
Error handling improvements:
- Updated the handler comparison in
func (b *messageBus) Unsubscribeto use pointer equality (Pointer()), ensuring that the correct handler is identified and unsubscribed. - Added specific error messages when a handler is not found for a topic or when the topic itself does not exist, making debugging easier.