[Twisted-Python] [Q] Naming Service for Twisted Servers

V S P toreason at fastmail.fm
Sun Jan 11 19:14:09 EST 2009


Thank you for all the replies regarding my question
of the Twisted Naming Server and in general multi-machine Event
Dispatching systems.

So far my understanding from all the replies is as follows

1) there is no pre-built naming server for twisted

2) there is no multi-machine message/event dispatching for twisted
(but there is, of course, a communication mechanism called Prospective
Broker)

3) for message/event dispatching people use Message Queue brokers
http://activemq.apache.org/  (Java)
or more peer-oriented http://www.openamq.org/  (C++ but no windows
support)

4) Naming service is considered to be part of 'Resource Discovery'
and therefore generic resource discovery tools can be deployed
such as Apple's Bonjour or Avahi (C, does not support windows)

5) Message Queueing / Brokers have several python libraries available
and some of them are already 'twisted-friendly'
such as https://launchpad.net/txamqp for O-AMQ
or http://pypi.python.org/pypi/stomper/0.1.0 for MQ 


6) message queuing servers, of course, already have name service
(that's part of the solution)

7)dbus-python library for python (the one that can be used to
communicate
with Bonjour or Avahi) appeared to be difficult to deploy.  
However, bonjour or Avahi specific python clients/examples are available
http://www.indelible.org/ink/twisted-bonjour/
http://avahi.org/wiki/PythonPublishExample


8) I did not ask this question -- but I was struggling to understand
how people implement long-running DB requests queries in twisted if it
if the whole framework is just single threaded (because of python GIL)
and cannot use more than one CPU core in parallel.

So far my understanding on that is as follows:
   a) Twisted developers can use Ampula for creating a pool of processes
   and asking the processes do the work (processes run an independed
   python
interpreter).  
   b) Twisted threads, while will use global lock on python operations
   -- will call concurently the C-level libraries that do database
   access (or other activities that are implemented in C libraries).  So
   the Twisted Event loop will not block waiting for a DB to respond, as
   long as the DB request was issued from a Thread.
   c) Twisted (now including Asynchronious event loop)
 works on JPython -- and that one (unlike CPython) has a fully threaded 
( and may be even more efficient) virtual machine and garbage collector.



Vlad
-- 
  V S P
  toreason at fastmail.fm

-- 
http://www.fastmail.fm - Faster than the air-speed velocity of an
                          unladen european swallow





More information about the Twisted-Python mailing list