我使用的是Play框架版本2.4.3,然后将其升级到2.6.0,我遇到了编译错误
myproject/app/controllers/Application.scala:146: value stream is not a member of Application.this.Status
[error] Ok.stream(responseStream).withHeaders("Content-Type" -> TextFormat.CONTENT_TYPE_004)
[error] ^
这是破坏代码
def prometheusMetrics = Action {
val responseStream = Concurrent.unicast[Array[Byte]] { channel =>
val writer = new WriterAdapter(channel)
TextFormat.write004(writer, CollectorRegistry.defaultRegistry.metricFamilySamples())
writer.close()
}
Ok.stream(responseStream).withHeaders("Content-Type" -> TextFormat.CONTENT_TYPE_004)
}
此代码在play 2.6中如何工作?