tyrus icon indicating copy to clipboard operation
tyrus copied to clipboard

TyrusSession.broadcast should allow the client to provide a predicate

Open glassfishrobot opened this issue 11 years ago • 3 comments

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

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]

glassfishrobot avatar Dec 06 '13 12:12 glassfishrobot

  • Issue Imported From: https://github.com/tyrus-project/tyrus/issues/456
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @pavelbucek

glassfishrobot avatar Feb 10 '18 20:02 glassfishrobot

@glassfishrobot Commented Reported by gdavison

glassfishrobot avatar Dec 06 '13 12:12 glassfishrobot

@glassfishrobot Commented This issue was imported from java.net JIRA TYRUS-279

glassfishrobot avatar Apr 25 '17 02:04 glassfishrobot