I just came back from Thanksgiving holidays :) Before working on the feature list, I would like to discuss Server/Sentence API style first. There are two styles to support more rich expression to find sockets:
1. Add finders to Server and Sentence - Cettia 1.0-1.1
2. Write pre-defined socket predicates and use them with server.find and sentence.find - inspired by Spring's RequestPredicates and RequestPredicate
Here is an example to find sockets tagged with foo and bar to help you understand.
1. server.byTag(foo, bar)
2. server.find(tag(foo).and(tag(bar))) w/ static import io.cettia.ServerSocketPredicates.*;
In this case, the first case looks more concise but if we want to find sockets tagged with tag1 or tag2, it becomes lengthy.
1. server.find(socket -> socket.tags().contains(foo) || socket.tags().contains(bar))
2. server.find(tag(foo).or(tag(bar)))
Even though we add a new method for this case, the same problem happens when finding sockets tagged with tag1 or tag2 and tag3 (tag1 || (tag2 && tag3)). I'm inclined to adopt the second option since Java 8 is the minimum requirement as of 1.2 but never used static imports to be honest. Do you guys have any opinion?
Thanks,