Thanks for the response. Until the poll event callback happens, what's the 
preferred way of dealing with lengthy requests? I'm evaluating mongoose for 
use in a fairly high-traffic situation where there will be dozens of 
requests per second, with many of the requests taking several seconds to 
complete. I have a thread pool set up to do the heavy lifting, but I'm not 
clear on how to tell mongoose that I've finished with the processing and 
that it can go ahead and transmit whatever hasn't been transmitted, close 
the connection, and do whatever clean-up it needs to do.

On Friday, February 21, 2014 4:12:58 AM UTC-5, Sergey Lyubka wrote:
>
> I plan to ditch MG_REQUEST_CALL_AGAIN feature, it is too messy IMO.
> Instead, on each mg_poll_server(), a callback will be called with POLL 
> event,
> regardless of the "long-running" status.
>
> Mongoose data sending functions do not actually send() the data to the 
> browser.
> They append the data to the output buffer and return immediately, to ensure
> non-blocking nature of the callback.
>
> Mongoose sends data on each mg_poll_server() iteration if socket is able 
> to send.
>
>
>
> On Fri, Feb 21, 2014 at 6:28 AM, <[email protected] <javascript:>> wrote:
>
>> I too am having a problem with a variation of this. It seems that when 
>> the handler is called again due to MG_REQUEST_CALL_AGAIN that neither 
>> mg_printf_data nor mg_send_data will actually send data to the browser. Is 
>> this by design and I'm just not understanding or is it a bug?
>>
>> What I'm ultimately trying to do is pass lengthy requests off to a thread 
>> and for each MG_REQUEST_CALL_AGAIN iteration I check to see if the 
>> thread has finished. However, in trying to debug why nothing was getting to 
>> the browser I ended up with simple code similar to the above.
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "mongoose-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/mongoose-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to