2

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.

Pengin
  • 4,692
  • 6
  • 36
  • 62

0 Answers0