Closed
Description
Instead of creating a new OnCompleted Notification object every time we need one, we could have one global instance, accessible by a factory method on Notification (suggested by @akarnokd here).
Advantages:
- Better performance, since fewer object (=garbage) creation
- Scala adaptor could have an
object OnCompleted
instead of aclass OnCompleted
which has to wrap a Java OnCompleted object.
Maybe we could also get 2) without any changes in Java, but then we might need to define clearly if the toScalaNotification
/toJavaNotification
methods have to preserve object identity, or only equals
.
Metadata
Metadata
Assignees
Labels
No labels