ScalaObservable.foreach doesn't block?

73 Views Asked by At

In the MongoDB Scala driver, ScalaObservable.foreach doesn't block as I expected. Since it returns Unit I can't use .toFuture it to wait either.

What's the way idiomatic way to wait? My program is quitting too early.

As a workaround I've replaced .foreach with a .map(f).toFuture where f: _ => Unit, then blocking on the future.

0

There are 0 best solutions below