What's the best way to communicate between processes?

awmcclain.nospam at gmail.com awmcclain.nospam at gmail.com
Wed Sep 27 04:41:12 EDT 2006


Here's my situation:

I'm writing a simple reminder bot which will IM me based on input from
a web server. Right now, I have a simple AIM bot written using twisted
2 words. It logs into AIM and can send/receive messages. There's part
1.

I have a django server running under mod_python through apache, which
is my web server. Part 2.

How do I get part 2 to talk to part 1?? Ideally I'd like to fire off a
(signal/message/data) from mod_python to a separate process running the
twisted AIM bot, so that the mod_python thread(s) can just forget about
the whole thing and let someone else deal with talking with AIM.

I can't really just include the twisted AIM bot from django, because
mod_python (as I understand it) runs different requests on different
threads, and I don't want to spawn a bot and log into IM each request.
I can't run the whole thing through twisted, either.

I'm thinking about coding some sort of 'local notify server' in twisted
(basically just listening to a socket and then passing the information
to the IM bot), then connecting to it via a python socket in django and
passing some serialized/pickled data. I worry about two requests
connecting to the 'notify server' at once, though, because i *cannot*
hang my web server.

Thoughts? Is there a better solution? Is there a simpler way to do this
(a way with built-in serialization?)

Thanks for any help.




More information about the Python-list mailing list