开发者

How to write services with CPython?

开发者 https://www.devze.com 2022-12-23 04:29 出处:网络
Does CPython have any library that helps to write binding-independent services? 开发者_运维技巧I have found some SOAP libraries for Python, but it misses the flexibility of choosing the binding at ru

Does CPython have any library that helps to write binding-independent services?

开发者_运维技巧I have found some SOAP libraries for Python, but it misses the flexibility of choosing the binding at runtime.


Packages such as SimpleXMLRPCServer (part of the Python standard library), SimpleJSONRPCServer, and probably at least some of the SOAP server-side libraries you found (the good ones;-), are based on the concept of registering functions and instances with the package to make them available to clients of the service -- basically you write your service's functionality independently, just exposing that functionality as functions and classes (much as you would for any other application's core logic, not just a service), and then, at runtime (presumably, mostly at server startup time), you register those functions, and instances of those classes, so they become accessible as "the service". I'd call that pretty much a "binding-independent" approach;-).

0

精彩评论

暂无评论...
验证码 换一张
取 消