how to use scala spray detach?

拥有回忆 提交于 2019-12-02 08:30:36

You are looking at a deprecated documentation. If you to want to read the current documentation you have to look at the spray.io website.

Regarding your problem, the current documentation specifies a different signature for the detach directive - see here

def detach()(implicit ec: ExecutionContext): Directive0
def detach()(implicit refFactory: ActorRefFactory): Directive0
def detach(ec: ExecutionContext): Directive0

As you are passing your ExecutionContext implicitly I guess, you have to write the parenthesis:

detach() {
  respondWithMediaType(`text/html`) { // XML is marshalled to `text/xml` by default, so we simply override here
    complete { ...
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!