Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
StructuredHub.Subscribe(pubsub.MatchAll, ...) works #3
Comments
|
Subscribe does need a TopicMatcher. Hard to know what you have changed without seeing the code. Sounds like there is some weirdness going on with your test, but hard to see. Got a gist or pastebin? Also, the multiplexer does use a different method because it is doing a different thing. Calling it subscribe would be wrong. |
howbazaar
self-assigned this
Jul 15, 2016
howbazaar
closed this
Apr 6, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jameinel commentedJul 14, 2016
Multiplexer uses a different method (Add) than Hub (Subscribe), but I was reworking a test to go straight to the hub instead of the Multiplexer, but it was perfectly happy with this:
sub, err := hub.Subscribe(pubsub.MatchAll, func(topic pubsub.Topic, s Emitter, err error) {
counters[mycounter]++
})
c.Assert(err, jc.ErrorIsNil)
defer sub.Unsubscribe()
I'm a bit surprised as I would think Subscribe requires a Topic, while Add requires a TopicMatcher, why would MatchAll be allowed as a Topic?
(The confusing part is the Subscribe passed just fine, but then none of the Publish()ed messages got through.)