I am working on a project which contains both Scala and Java code. I have a Scala method defined as :
var responseListeners: List[(Int) => Unit]
def addResponseListener(onResponse: Int => Unit) {
responseListeners ::= onResponse
}
And this method is called in Scala as:
addResponseListener(id => processors(id).wakeup())
Now I have some Java code in which I have access to the processors array, but how do I call the addResponseListener(onResponse: Int => Unit) from Java?