March 01, 2021 09:44AM
Vladimir Homutov Wrote:
-------------------------------------------------------
> On Mon, Mar 01, 2021 at 04:07:47AM -0500, dvhh wrote:
> > Hello,
> >
> > I have developed a module which perform long running calculations to
> produce
> > the output, unfortunately blocking the server thread from handling
> other
> > requests. I am looking at using threadpool, unfortunately there is
> no
> > example of using threadpool with module that I could find.
> >
> > I am using src/http/modules/ngx_http_image_filter_module.c as a base
> for my
> > code.
> >
> > How would you modify such module to perform the image processing in
> > background threads ?
> >
>
> It is documented:
>
> http://nginx.org/en/docs/dev/development_guide.html#threads
>
> You may also look at how nginx implements reading files using threads:
>
> http://hg.nginx.org/nginx/file/tip/src/os/unix/ngx_files.c#l95
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Thanks Vladimir,

I have already consulted the documentation and tried implemented it, task is successfully executed.
The current main issue, is how/when to send the calculated response
Using the completion function look like a good bet, by I the have little clue on how to send response/chain to the next filter from there.
Subject Author Posted

Seeking example of module using theadpool

dvhh March 01, 2021 04:07AM

Re: Seeking example of module using theadpool

Vladimir Homutov March 01, 2021 04:26AM

Re: Seeking example of module using theadpool

dvhh March 01, 2021 09:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready