473,395 Members | 1,418 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What's the best way to communicate between processes?

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.

Sep 27 '06 #1
4 3022
In message <11*********************@i42g2000cwa.googlegroups. com>,
aw**************@gmail.com wrote:
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.
That sounds like the right sort of thing. I've done this sort of thing
myself, though I've been careful not to use any language-specific
communication formats.
I worry about two requests
connecting to the 'notify server' at once, though, because i *cannot*
hang my web server.
Your Web server won't hang. The particular Web server thread/process waiting
for the request to be serviced will be held up, and so of course will the
particular user sitting in front of the browser waiting for a response from
that thread/process, but nobody else will notice anything.
Sep 27 '06 #2
aw**************@gmail.com wrote:
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.
Use the XML-RPC server gateway from Twisted on the server side. In
the Django web pages then use xmlrpclib module to initiate XML-RPC
requests to the server.

Graham

Sep 27 '06 #3
In general, are sockets used for intra-machine communication less
likely to fail/hang than, say, trying to connect across countries? I
would think so, right?

How do web servers handle connections to SQL databases? Do they spawn a
thread? Or is it all inline? Seems like that's the type of
behaviour/connection I'd like to model.

Lawrence D'Oliveiro wrote:
In message <11*********************@i42g2000cwa.googlegroups. com>,
aw**************@gmail.com wrote:
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.

That sounds like the right sort of thing. I've done this sort of thing
myself, though I've been careful not to use any language-specific
communication formats.
I worry about two requests
connecting to the 'notify server' at once, though, because i *cannot*
hang my web server.

Your Web server won't hang. The particular Web server thread/process waiting
for the request to be serviced will be held up, and so of course will the
particular user sitting in front of the browser waiting for a response from
that thread/process, but nobody else will notice anything.
Sep 27 '06 #4
In message <11*********************@b28g2000cwb.googlegroups. com>,
aw**************@gmail.com wrote:
...
Don't top-post.
Sep 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
1
by: bscofield | last post by:
Hi, I'm a db app. developer and I am re-writing some helps in javascript & HTML. The Javascript is for form flow and design and HTML just to display the helps. I use a seperate app. development...
8
by: JohnFol | last post by:
I have a requirement to run some code on a server. The purpose of the code is purely to process data between an MS SQL box and a remote Oracle box. It has no UI, and needs no user intervention to...
2
by: needin4mation | last post by:
What is .NET remoting versus Ajax? Any links are appreciated. I didn't find a straight forward answer. Thanks for any help.
14
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I...
8
by: Henrik | last post by:
Hi Is there any way to see what the System process is doing? We have developed an application running at a production site to measure and optimize the production. The application needs to be...
6
by: seb | last post by:
Hi, I am using pygtk for the first times. I am wondering what would be the best "pattern" to interface pygtk with a thread. The thread is collecting informations (over the network for...
12
by: MrQuan | last post by:
G'day all, I have a requirement to communicate between two or more PCs over the Internet, however I have no idea how to go about this. I'm not talking about a chat programme as such, I want to...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.