[Twisted-Python] Using Twisted for a clustering library.
Itamar Shtull-Trauring
twisted at itamarst.org
Wed Jun 12 17:24:20 MDT 2002
Patrick B. Day wrote:
> After browsing through the Twisted source, I'm guessing that I'll need to
> write my own Reactor, Protocol, Factory, Application classes and possibly
> a new main module. Does this sound about right or am I over complicating
> things?
1) No need for new reactor class - let processes communicate via unix
sockets (reactor.listenTCP). Or TCP (reactor.listenTCP). Or use
reactor.spawnProcess and communicate via stdin/stdout.
2) No need for new Application class - use the existing one. Or just use
the reactor object directly.
3) You can write your own protocol, which means a new Protocol and
Factory, yes. Or you can use twisted.spread.pb, a remote object
protocol, which almost certainly has all functionality you need.
I recommend reading the writing servers tutorial:
http://twistedmatrix.com/documents/howto/servers
And look at simple example in tarball - doc/examples/simpleserv.py.
Then read the API docs for reactors in twisted.internet.interfaces.
More information about the Twisted-Python
mailing list