You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Craig S <cr...@yahoo.com> on 2004/10/14 04:10:54 UTC

[users@httpd] Asynchronous page creation?

>From what I can tell, Apache passes a request to a
handler and expects a result to be written by that
handler. What I want to do is send information from
the message to do a query of a database that will
return an answer later on. I'd like to return from the
handler and create the result page later on when the
answer comes back. 

My hope is to reduce the need for multiple threads or
processes.

Any pointers?

Thanks,

-Craig

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Asynchronous page creation?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 05:51 PM 10/14/2004, Craig S wrote:
>After digging into the code (nice job by the way, it
>is  very easy to follow), it looks like there is no
>way to do what I want without modifications to the
>core server (the worker code).

The point to the MPM technology is that you can replace
(e.g. build upon) an existing mpm with whatever technology
you want to use to handle state and connection management.

When httpd ultimately becomes an async server, the first
code that we will change will be the mpm.  As this is user
developed software, you are welcome to beat us to the punch,
either an independent third party module, or as a contribution
to the httpd development effort.

Bill 


Re: [users@httpd] Asynchronous page creation?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 05:51 PM 10/14/2004, Craig S wrote:
>After digging into the code (nice job by the way, it
>is  very easy to follow), it looks like there is no
>way to do what I want without modifications to the
>core server (the worker code).

The point to the MPM technology is that you can replace
(e.g. build upon) an existing mpm with whatever technology
you want to use to handle state and connection management.

When httpd ultimately becomes an async server, the first
code that we will change will be the mpm.  As this is user
developed software, you are welcome to beat us to the punch,
either an independent third party module, or as a contribution
to the httpd development effort.

Bill 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Asynchronous page creation?

Posted by Greg Ames <gr...@remulak.net>.
Craig,

If I understand what you want to do, I've done a little like that with 
modifications mostly to the worker MPM for httpd-2.1.  The patch is here -
http://apache.org/~gregames/event.patch .

But I was primarily interested in low hanging fruit - threads that are between 
HTTP requests.  I picked them because they don't need a lot of state information 
to be saved and restored when the connection changes threads, and because we 
often see a lot of threads tied up in keepalive timeouts and lingering close 
processing.

If you want to exit a thread while it is executing a handler which is doing 
database calls, there will be a lot more state that needs to move between 
threads.  But maybe this will give you a start.

Good luck,
Greg

p.s. disclaimer - the event.patch has some known issues posted at 
http://apache.org/~gregames/event.laundry_list

Craig S wrote:
> After digging into the code (nice job by the way, it
> is  very easy to follow), it looks like there is no
> way to do what I want without modifications to the
> core server (the worker code).
> 
> Has there been any discussion about having handlers
> return a DEFERRED indication up to process_socket(),
> so the transaction information can be saved until a
> later event can answer the request?
> 
> -Craig
> 
> 
> 
> --- Craig S <cr...@yahoo.com> wrote:
> 
> 
>>>From what I can tell, Apache passes a request to a
>>handler and expects a result to be written by that
>>handler. What I want to do is send information from
>>the message to do a query of a database that will
>>return an answer later on. I'd like to return from
>>the
>>handler and create the result page later on when the
>>answer comes back. 
>>
>>My hope is to reduce the need for multiple threads
>>or
>>processes.
>>
>>Any pointers?
>>
>>Thanks,
>>
>>-Craig



Re: [users@httpd] Asynchronous page creation?

Posted by Craig S <cr...@yahoo.com>.
After digging into the code (nice job by the way, it
is  very easy to follow), it looks like there is no
way to do what I want without modifications to the
core server (the worker code).

Has there been any discussion about having handlers
return a DEFERRED indication up to process_socket(),
so the transaction information can be saved until a
later event can answer the request?

-Craig



--- Craig S <cr...@yahoo.com> wrote:

> From what I can tell, Apache passes a request to a
> handler and expects a result to be written by that
> handler. What I want to do is send information from
> the message to do a query of a database that will
> return an answer later on. I'd like to return from
> the
> handler and create the result page later on when the
> answer comes back. 
> 
> My hope is to reduce the need for multiple threads
> or
> processes.
> 
> Any pointers?
> 
> Thanks,
> 
> -Craig
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Asynchronous page creation?

Posted by Craig S <cr...@yahoo.com>.
After digging into the code (nice job by the way, it
is  very easy to follow), it looks like there is no
way to do what I want without modifications to the
core server (the worker code).

Has there been any discussion about having handlers
return a DEFERRED indication up to process_socket(),
so the transaction information can be saved until a
later event can answer the request?

-Craig



--- Craig S <cr...@yahoo.com> wrote:

> From what I can tell, Apache passes a request to a
> handler and expects a result to be written by that
> handler. What I want to do is send information from
> the message to do a query of a database that will
> return an answer later on. I'd like to return from
> the
> handler and create the result page later on when the
> answer comes back. 
> 
> My hope is to reduce the need for multiple threads
> or
> processes.
> 
> Any pointers?
> 
> Thanks,
> 
> -Craig
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail