Summary
We looked at transmitting and sharing objects using RESTful web services and the wsgiref
module, as well as the multiprocessing
module. Both of these architectures provide for communicating a representation of an object's state. In the case of multiprocessing
, pickle is used to represent the state. In the case of building RESTful web services, we have to choose the representation(s) used. In the examples used here, we focused on JSON because it's widely used and has a simple implementation. Many frameworks will offer simple implementations of XML as well.
Performing RESTful web services using a WSGI application framework formalizes the process of receiving HTTP requests, deserializing any objects, performing the requested processing, serializing any results, and providing a response. Because WSGI applications have a simple, standardized API, we can easily create composite applications and write wrapper applications. We can often leverage wrapper applications to handle the authentication...