-
Notifications
You must be signed in to change notification settings - Fork 5.5k
RTopic Superclass Listener #731
Copy link
Copy link
Closed
Description
It would be quite useful to be able to add a MessageListener of any generic type, or at least supertypes. This would be extremely useful for topics that might contain multiple types of packets, especially when subscribing to a pattern. Thanks for considering it :)
RTopic<CharSequence> topic = redisson.getTopic("test");
topic.addListener(new MessageListener<String>() {
@Override
public void onMessage(String s, String string) {
}
});
topic.addListener(new MessageListener<StringBuilder>() {
@Override
public void onMessage(String s, StringBuilder charSequence) {
}
});
Lambda Support:
topic.<StringBuilder>addListener((s, builder) -> {
});
Reactions are currently unavailable