[hunchentoot-devel] Using multiple Hunchentoot-Requests in one thread

css css at swissjabber.ch
Wed May 28 23:15:57 UTC 2008


2008/5/29 Chris Dean <ctdean at sokitomi.com>:
>
>> That is, I want to get the request-object, and then pass it to
>> another thread, who is then handling multiple requests (i.e. sending
>> "non-waiting", polling for input, etc.). Is this possible?
>
> I'm not sure I follow.  Do you want to get the output stream (and/or
> the input stream) and pass that to another thread for processing?  I
> don't know the answer, just trying to clarify.
>
> Cheers,
> Chris Dean

Hm. I guess what I want is best explained as some "Polling-Mode" for
requests. I.e. having a main loop in one thread, "polling" or waiting
for new requests, an then scheduling myself the input and output
inside this one thread. My problem is that the number of threads I can
use is bounded at a low bound, and I do not want to "waste" threads
for something, that doesnt need them - i.e. I would like to schedule
the requests and their processing myself, not relying on some threaded
interface. I wonder if this is possible with hunchentoot.

Hm. Maybe some "pseudocode" shows, what I mean. I have a loop with the
following "content"

(some-infinite-loop
  (if (new-connection-arrived) (push request requests-to-answer))
  (dolist (req requests-to-answer)
    (continue-processing req) ; do some small action that continues
the processing of req
  ))

That is, basically, what I want to do. Or at least something similar.
Can this be done?



More information about the Tbnl-devel mailing list