一般接口是通过webservice或http api来实现的,但如果是同一台服务器内,则可以使用gearman或thrift来注册服务和调用。
- Gearman http://gearman.org/
客户端和服务端可以使用不同的编程语言实现。
如果使用php,则可以使用GearmanManager来管理服务端的代码,将服务程序放到某个目录,这些程序会自动驻留。可以考虑使用ZooKeeper管理异构程序。
- Thrift http://thrift.apache.org/
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
Thrift比较麻烦的是要定义配置文件,跟wsdl一样,稍麻烦些。