除了使用Thrift服务之外,还有没有其他方法可以从PHP调用Scala函数?最开始我尝试了Thrift服务,但是问题在于它有时候可以工作,有时候却不行。是否有更简便的解决办法?
下面的代码是我的server.scala程序
try {
val serverTransport: TServerSocket= new TServerSocket(9778)
val processor = new User_nodeService.Processor(User_node)
val args1:Args = new Args(serverTransport)
args1.processor(processor)
val server:TServer = new TThreadPoolServer(args1)
println("Started service successfully...")
server.serve()
}
有时候我会在"
args1.processor(processor)
"这行代码上遇到错误 "value processor is not a member of org.apache.thrift.server.TThreadPoolServer.Args
",但有时候这段代码又能正常运行。
processor
为org.apache.thrift.TProcessor
,会发生什么? - Carsten