eclipse-ee4j / eclipse-ee4j/tyrus

TyrusSession.broadcast should allow the client to provide a predicate

Open
#456 3 comments 0 reactions 0 assignees View on GitHub
Component: core Priority: Major Type: Improvement
Dominant language
Java
Stars
128
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I feel that TyrusSession.broadcast should take a Predicate filter so that messages can easily be sent to sub sections of the connected clients.

So it should be possible to do something like this:

((TyrusSession)session).broadcast(message, s -> s.getUserProperties().conains("NAME"));

Ideally the interface should be serialisable so that the same expression could be used across the cluster as per bug #455, you do need to be a little bit careful in this case as this blog shows:

[http://kingsfleet.blogspot.co.uk/2013/12/lambda-will-it-serialize.html](http://kingsfleet.blogspot.co.uk/2013/12/lambda-will-it-serialize.html)

Obviously the code will be written in a form that will work with JDK6 but can be more pleasant to use with JDK 8.
#### Affected Versions
[1.3.1]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.