playframework/playframework — pull request #2469 by pvlugter (2014-03-10 03:03:30+00:00)
Title: Add Java 8 lambda-friendly factory method to EventSource

From Java 8 this allows:
```java
EventSource.whenConnected(es -> clock.tell(es, null));
```
in place of:
```java
new EventSource() {
public void onConnected() {
clock.tell(this, null);
}
}
```

If this useful then similar factory methods can be added for Comet and Websocket, and possibly other classes that are usually implemented with anonymous classes but are not functional interfaces.