我有导入import play.api.libs.concurrent.Execution.Implicits._
val lock1 = lock(tweet)
val lock2 = lock(tweet)
for {
r1 <- lock1
r2 <- lock2
} yield r1 -> r2
但是这个区块抱怨
Cannot find an implicit ExecutionContext, either require one yourself or import ExecutionContext.Implicits.global
[error] r2 <- lock2
[error] ^
答案 0 :(得分:0)
import scala.concurrent.ExecutionContext.Implicits.global
导入此工作正常。但我不知道为什么