Play Framework 2.1-找不到隐式的ExecutionContext [英] Play Framework 2.1 - Cannot find an implicit ExecutionContext

查看:183
本文介绍了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'")
  }
}

完整错误:Error: Cannot find an implicit ExecutionContext, either require one yourself or import 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆