gpt4 book ai didi

gradle - Ratpack中的非阻塞处理程序代码不起作用

转载 作者:行者123 更新时间:2023-12-03 03:42:06 26 4
gpt4 key购买 nike

我正在尝试遵循this blogpost,该示例演示了ratpack中的阻塞处理程序,但无法正常工作。我正在为背景缺少方法异常。

我的build.gradle文件如下this GitHub directory

buildscript {
repositories {
maven { url "http://oss.jfrog.org/artifactory/repo" }
jcenter()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:0.9.4'
}
}

apply plugin: "ratpack-groovy"
apply plugin: "idea"
apply plugin: "eclipse"

repositories {
maven { url "http://oss.jfrog.org/artifactory/repo" }
jcenter()
maven { url "http://repo.springsource.org/repo" }
maven { url "https://nexus.codehaus.org/content/repositories/snapshots/" }
}

dependencies {
springloaded "org.springsource.loaded:springloaded:1.1.5.RELEASE"

testCompile "org.spockframework:spock-core:0.7-groovy-2.0", {
exclude module: "groovy-all"
}
}

// The Groovy that rest-assured drags in via ratpack-groovy-test is toxic, prevent it from coming in
// This should be fixed upstream in Ratpack
configurations.testCompile.dependencies.find { it.name == "ratpack-groovy-test" }.exclude(group: "org.codehaus.groovy")

处理程序代码如下。
import static ratpack.groovy.Groovy.ratpack

ratpack {
handlers {
get("non-blocking") {
background {
Thread.sleep(10000)
}.then{
response.send()
}
}
}
}

我正在为背景缺少方法异常。
groovy.lang.MissingMethodException: No signature of method: nonBlocking.background() is applicable for argument types: (nonBlocking$_run_closure1$_closure2$_closure3$_closure4) values: [nonBlocking$_run_closure1$_closure2$_closure3$_closure4@497352d0]
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:81)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at

最佳答案

关于gradle - Ratpack中的非阻塞处理程序代码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46009278/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com