-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Labels
Compatibility 🧭Tasks & PRs for compatibility of GLIDE with other clientsTasks & PRs for compatibility of GLIDE with other clients
Description
Overview
Support Jedis-style JedisPubSub callback listeners in the compatibility layer to enable full PubSub functionality with message handling.
Background
PR #5286 adds basic PubSub commands (publish, pubsubChannels, pubsubNumSub, pubsubNumPat) to the Jedis compatibility layer. However, the subscribe/unsubscribe methods with JedisPubSub callbacks are not yet implemented.
Requested Feature
Implement JedisPubSub and BinaryJedisPubSub callback support to match the Jedis API:
JedisPubSub jedisPubSub = new JedisPubSub() {
@Override
public void onMessage(String channel, String message) {
// Handle message
}
@Override
public void onSubscribe(String channel, int subscribedChannels) {
// Handle subscription
}
@Override
public void onUnsubscribe(String channel, int subscribedChannels) {
// Handle unsubscription
}
};
jedis.subscribe(jedisPubSub, "channel1", "channel2");Implementation Considerations
- Map JedisPubSub callbacks to GLIDE's dynamic subscription APIs
- Support both JedisPubSub (String) and BinaryJedisPubSub (byte[]) variants
- Handle pattern subscriptions (psubscribe) and sharded subscriptions (ssubscribe)
- Ensure thread-safety for callback execution
- Consider blocking vs non-blocking subscription models
Related
- PR feat(jedis-compatibility): add pub sub commands jedis layer #5286 (basic PubSub commands)
- Issue (jedis-compatibility): Add PubSub commands support #5285 (parent issue for PubSub support)
Labels
Feature, java
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Compatibility 🧭Tasks & PRs for compatibility of GLIDE with other clientsTasks & PRs for compatibility of GLIDE with other clients