I try to make the return Unit function (this is to implement the RxScala observer), but when I add () to the end, I get the error "Application does not accept parameters." Here is my code:
val client3MessageStreamObserver: Observable[Message] = client3.messageStream() client3MessageStreamObserver.subscribe( m => println("Unexpected message received by client3"), // callback for handling exceptions t => println("Ex client3: " + t) // want to make this line work (which it doesn't) which is why // I need to be able to return Unit. // client3TestPromise.success(true) () // error after adding Unit literal here. )
Why am I getting this error after adding () and how can I get rid of it? If I leave this, I get the error message "Type of mismatch: Expected (Throwable) => Unit, actual: (Throwable) => Any)".
source share