Open flowersinthesand opened 10 years ago
Expression Language like JSP EL, OGNL, SPEL would be adopted as well. It's easy to adopt since there is already implementation for similar reason but it's only for Java. It might make the protocol specific language-dependent.
A plain SAM in Java 8 would be considered also. However it is too similar to a usage of SAM as filter in all method.
server.by(s-> s.tags().contains("a") && !s.id().equals("881f80cf-4f8b-4065-8286-b42f2fb62a51"));
Currently id and tag are provided as selector for socket, but there is no universal selector concept. The universal selector format will make it neat and enjoyable to do 'select some sockets and do something with them' pattern. It's worth sacrificing performance within limits.
In any format, we might need to modify and accept it in our own way but I don't want to reinvent the wheel and modify too much things.
URI
It deals with id and tag as path component of URI which doesn't start with '/'.
a/*
anda/**
match witha/b
anda/c
for former anda/b
,a/b/d
,a/c
,a/c/e
for latter respectively.CSS
It deals with id and tag as similar one from CSS selector.
.a:not(#881f80cf-4f8b-4065-8286-b42f2fb62a51)
: Tag a excluding id 881f80cf-4f8b-4065-8286-b42f2fb62a51 that is a typical pattern meaning 'everybody in room, a, excpet specific one'.SQL
It thinks of given selector as where clause where the fixed SQL is
select socket from server where ${selector}
and regard socket's properties like uri, id, tags as column of table.tags in a and id <> 881f80cf-4f8b-4065-8286-b42f2fb62a51
: the same as above.