本文介绍了Play Framework 2.1 - 找不到隐式的 ExecutionContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用这样的网络服务:

I am calling a webservice like this:

WS
  .url(url)
  .get
  .map { response => // error occurs on this line
    response.status match {
      case 200 => Right(response.json)
      case status => Left(s"Problem accessing api, status '$status'")
  }
}

完整错误:错误:找不到隐式的ExecutionContext,要么自己需要,要么导入ExecutionContext.Implicits.global

推荐答案

根据这个问题,它在文档.我需要添加以下导入:

According to this issue, it is fixed in the documentation. I needed to add the following import:

import play.api.libs.concurrent.Execution.Implicits._

这篇关于Play Framework 2.1 - 找不到隐式的 ExecutionContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-10 21:56