simple and fast platform independent IPC

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Feb 3 10:34:34 CET 2010


On Feb 3, 8:32 am, News123 <news... at free.fr> wrote:
> Hi,
>
> I wondered what IPC library might be best simplest for following task?
>
> I'm having a few python scripts all running on the same host (linux or
> win), which are started manually in random order. (no common parent process)
> Each process might be identified by an integer (1,2,3) or by a symbolic
> name ( 'dad' , 'mom' , 'dog' )
>
> these scripts want to send short messages to each other ( mostly
> integers, max a few bytes, short string), which would be enqueued in
> message queues of the receiving process.
>
> example:
>
> 'dad' wants to tell 'mom': 'cook'
> 'dog' wants to tell 'dad' : 'feedme'
> 'mom' wants to tell 'dad' : 'cookyourself'
>
> the receiver dos not necesarily have to know who sent the message
>
> a message shall be dropped silently if the receiving process is not running
>
> a message shall be reliably delivered if the receiving process is up
>
> xmlrpc seems to be a little heavy for such tasks.
>
> signals don't allow to exchange data
>
> a shared memory message queue would probably a good solution, but
> python's Multiprocessing.Queue  seems to require a common parent process
>
> thanks a lot for any ideas / suggestions
>
> N
>
> N

Gabriel's suggestion is very good; if you need something which is a
little more like RPC but still quite lightweight, consider Pyro
(http://pyro.sourceforge.net/)

Regards,

Vinay Sajip



More information about the Python-list mailing list