| 1 |
Foolscap |
|---|
| 2 |
(aka newpb, aka pb2) |
|---|
| 3 |
|
|---|
| 4 |
This is a ground-up rewrite of Perspective Broker, which itself is Twisted's |
|---|
| 5 |
native RPC/RMI protocol (Remote Procedure Call / Remote Method Invocation). |
|---|
| 6 |
If you have control of both ends of the wire, and are thus not constrained to |
|---|
| 7 |
use some other protocol like HTTP/XMLRPC/CORBA/etc, you might consider using |
|---|
| 8 |
Foolscap. |
|---|
| 9 |
|
|---|
| 10 |
Fundamentally, Foolscap allows you to make a python object in one process |
|---|
| 11 |
available to code in other processes, which means you can invoke its methods |
|---|
| 12 |
remotely. This includes a data serialization layer to convey the object |
|---|
| 13 |
graphs for the arguments and the eventual response, and an object reference |
|---|
| 14 |
system to keep track of which objects you are connecting to. It uses a |
|---|
| 15 |
capability-based security model, such that once you create a non-public |
|---|
| 16 |
object, it is only accessible to clients to whom you've given the |
|---|
| 17 |
(unguessable) FURL. You can of course publish world-visible objects that |
|---|
| 18 |
have well-known FURLs. |
|---|
| 19 |
|
|---|
| 20 |
Full documentation and examples are in the doc/ directory. |
|---|
| 21 |
|
|---|
| 22 |
DEPENDENCIES: |
|---|
| 23 |
|
|---|
| 24 |
* Python 2.4 or later |
|---|
| 25 |
* Twisted 2.4.0 or later |
|---|
| 26 |
* PyOpenSSL (tested against 0.6) |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
INSTALLATION: |
|---|
| 30 |
|
|---|
| 31 |
To install foolscap into your system's normal python library directory, just |
|---|
| 32 |
run the following (you will probably have to do this as root): |
|---|
| 33 |
|
|---|
| 34 |
python setup.py install |
|---|
| 35 |
|
|---|
| 36 |
You can also just add the foolscap source tree to your PYTHONPATH, since |
|---|
| 37 |
there are no compile steps or .so/.dll files involved. |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
COMPATIBILITY: |
|---|
| 41 |
|
|---|
| 42 |
Foolscap is still under development. The wire protocol is almost certainly |
|---|
| 43 |
going to change in the near future, so forward compatibility between |
|---|
| 44 |
versions is *NOT* yet guaranteed. Do not use Foolscap if you do not have |
|---|
| 45 |
continuing control over both ends of the wire. Foolscap is not yet suitable |
|---|
| 46 |
for widespread deployment: for production applications please continue to |
|---|
| 47 |
use oldpb (in twisted.spread). |
|---|
| 48 |
|
|---|
| 49 |
Foolscap has a built-in version-negotiation mechanism that allows the two |
|---|
| 50 |
processes to determine how to best communicate with each other. The two ends |
|---|
| 51 |
will agree upon the highest mutually-supported version for all their |
|---|
| 52 |
traffic. If they do not have any versions in common, the connection will |
|---|
| 53 |
fail with a NegotiationError. |
|---|
| 54 |
|
|---|
| 55 |
Certain releases of Foolscap will remain compatible with earlier releases. |
|---|
| 56 |
Please check the NEWS file for announcements of compatibility-breaking |
|---|
| 57 |
changes in any given release. |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
NAMING: |
|---|
| 61 |
|
|---|
| 62 |
The established version of PB that has been around for years is referred to |
|---|
| 63 |
here as "oldpb". The new version contained in this release is known as |
|---|
| 64 |
"Foolscap", but at various points of its development was known as "newpb" or |
|---|
| 65 |
"pb2". The release tarballs are named "foolscap-x.y.z". The python module |
|---|
| 66 |
name is "foolscap" . These names are still in flux. At some point in the |
|---|
| 67 |
future, we may come up with a suitably clever and confusing name that will |
|---|
| 68 |
replace any or all of these. |
|---|
| 69 |
|
|---|
| 70 |
A "foolscap" is a size of paper, probably measuring 17 by 13.5 inches. A |
|---|
| 71 |
twisted foolscap of paper makes a good fool's cap. Also, "cap" makes me |
|---|
| 72 |
think of capabilities, and Foolscap is a protocol to implement a distributed |
|---|
| 73 |
object-capabilities model in python. |
|---|
| 74 |
|
|---|
| 75 |
AUTHOR: |
|---|
| 76 |
|
|---|
| 77 |
Brian Warner is responsible for this thing. Please discuss it on the |
|---|
| 78 |
twisted-python mailing list. |
|---|
| 79 |
|
|---|
| 80 |
The Foolscap home page is a Trac instance at <http://foolscap.lothar.com>. |
|---|
| 81 |
It contains pointers to the latest release, bug reports, patches, |
|---|
| 82 |
documentation, and other resources. |
|---|
| 83 |
|
|---|
| 84 |
Foolscap is distributed under the same license as Twisted itself, namely the |
|---|
| 85 |
MIT license. Details are in the LICENSE file. |
|---|