]> git.kaiwu.me - njs.git/commit
Modules: added worker_affinity parameter for js_periodic directive.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Sep 2023 16:17:10 +0000 (09:17 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Sep 2023 16:17:10 +0000 (09:17 -0700)
commitedf96120b7453d9db64dda069963abd61f416ccd
tree738c27fef322614ac217d78aaee592a73ee3a481
parent242dfdf9e87d8d5510f359bf67d2f3bc033ad8f4
Modules: added worker_affinity parameter for js_periodic directive.

worker_affinity specifies on what set of workers the js_periodic handler
should be executed. By default the js_handler is executed only on worker 0.
The parameter accepts a binary mask or "all" to specify all workers.

example.conf:
worker_processes 4;

...
    location @periodics {
        # to be run at 1 minute intervals in worker 0
        js_periodic main.handler interval=60s;

        # to be run at 1 minute intervals in all the workers
        js_periodic main.handler interval=60s worker_affinity=all;

        # to be run at 1 minute intervals in workers 1 and 3
        js_periodic main.handler interval=60s worker_affinity=0101;
    }
nginx/ngx_http_js_module.c
nginx/ngx_stream_js_module.c
nginx/t/js_periodic.t
nginx/t/stream_js_periodic.t