#100 -- Fix addPubSubHandler not checking if already added
Motivation
The extension APIs on Channel for managing Redis Channels are more appropriate to exist on ChannelPipeline directly.
In addition, the method of adding/removing PubSub handlers were not race-condition proof, as evidenced by issue #100 (closed).
Changes Made
- Add: New API for removing PubSubHandler
NIO.ChannelPipeline.removeRedisPubSubHandler(_:)
- Rename:
NIO.Channel.addBaseRedisHandlers()
toNIO.ChannelPipeline.addBaseRedisHandlers()
- Rename:
NIO.Channel.addPubSubHandler()
toNIO.ChannelPipeline.addRedisPubSubHandler()
Result
Developers should no longer see race conditions when calling RedisClient.subscribe
or RedisClient.unsubscribe
.
This addresses issue #100 (closed) directly.
Edited by Nathan Harris