Apache module, is it possible to have asynchronous processing

Posted by prashant2361 on Stack Overflow See other posts from Stack Overflow or by prashant2361
Published on 2010-05-04T02:32:54Z Indexed on 2010/05/04 2:38 UTC
Read the original article Hit count: 275

Filed under:

Hi,

I have a requirement where I need to send continous updates to my clients. Client is browser in this case. We have some data which updates every sec, so once client connects to our server, we maintain a persistent connection and keep pushing data to the client.

I am looking for suggestions of this implementation at the server end. Basically what I need is this: 1. client connects to server. I maintain the socket and metadata about the socket. metadata contains what updates need to be send to this client 2. server process now waits for new client connections 3. One other process will have the list of all the sockets opened and will go through each of them and send the updates if required.

Can we do something like this in apache module: 1. apache process gets the new connection. It maintains the state for the connection. It keeps the state in some global memory and returns back to root process to signify that it is done so that it can accept the new connection 2. the apache process though has returned the status to root process but it is also executing parallely where it going through its global store and sending updates to the client, if any.

So can a apache process do these things: 1. Have more than one connection associated with it 2. Asynchronously waiting for new connection and at the same time processing the previous connections?

Regards Prashant

© Stack Overflow or respective owner

Related posts about apache