jdeppe-pivotal commented on a change in pull request #5639:
URL: https://github.com/apache/geode/pull/5639#discussion_r507977581



##########
File path: 
geode-redis/src/main/java/org/apache/geode/redis/internal/pubsub/Subscription.java
##########
@@ -53,11 +53,15 @@ void publishMessage(byte[] channel, byte[] message,
   List<Object> createResponse(byte[] channel, byte[] message);
 
   /**
-   * Return the subscription name. In the case of a pattern the string 
representation of the
-   * pattern is returned.
+   * Return the channel name. In the case of a pattern null is returned.
    */
   byte[] getChannelName();
 
+  /**
+   * Return the pattern name. In the case of a channel null is returned.
+   */
+  byte[] getPatternName();

Review comment:
       I see what the problem is now. I think it would be better to provide a 
`Type` enum into the `Subscription` interface:
   ```
     enum Type {
       CHANNEL,
       PATTERN;
     }
   
     Type getType();
   ```
   
   And then you should be able to filter by that when you need to have methods 
distinguish the type of subscription.
   
   In the `PubSub` interface you can add:
   ```
   List<byte[]> findSubscribedChannels(Client client, Subscription.Type type);
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to