我已经启动了一个在Scala上编写异步PostgreSQL驱动程序的项目,要成为异步的,我需要接受回调并使用将来,但是接受回调和未来会使代码变得很麻烦,因为您总是必须发送回调,即使它是无用的。"insert a row in the database" in {
(handler, future) => handler.sendQuery( this.create ){ query => }.get( 5, Time
大多数时候,我的FutureT操作依赖于链中以前的未来。我大部分时间都在使用带有模式匹配的flatMap函数。例如; case None => Future.successful(NotFound("No user with given id")) case None => Future.successful(NotFound("No address with given