How to call scala function from php?

Is there any method to call the Scala function from PHP other than the Thrift service? I initially tried the Thrift service, but the problem is that it works several times, and sometimes not. Is there an easy solution to this problem?

The code below is my server.scala program

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() } 

Sometimes I get this error " value processor is not a member of org.apache.thrift.server.TThreadPoolServer.Args " in the line " args1.processor(processor) ", and sometimes the code works fine.

+4
source share
1 answer

You can try the mechanism, there is a version of scala

https://github.com/efuquen/scala-gearman

http://gearman.org/

0
source

Source: https://habr.com/ru/post/1478956/


All Articles