Skip to content

RTopic Superclass Listener #731

@Exerosis

Description

@Exerosis

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) -> {

        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions