> hello fellow uWSGI patrons,
>
> i am trying to write a mechanism to modify the python loglevel of
> specific modules on-the-fly.  i can use @rpc or lower to call into my
> app externally, and it runs on some worker X, which is fine.  the
> problem arises when i want to relay that message to all other workers
> ... how to accomplish this?
>
>  - uwsgi.register_rpc doesn't support a target, so i can't
> @rpc(target='workers')
>  - registering a 'workers' signal works great, but does not support args
> :-(
>  - i can't quite seem to figure out how the mule_farm stuff works ...
>  - ... but even if i did, msg would only go to one mule anyway.
>
> ... what's the best way?  all i can think of is:
>
> a) rpc call from the outside
> b) signal 'workers'
> c) all workers read some shared memory area
>
> ... am i overlooking a simpler method?  would be nice if @rpc and
> lower supported the same magic keys as signals.
>
> --
>

Maybe i would map a socket to each worker:

[uwsgi]
master = true
processes = 4
; generic socket
socket = :3030
; socket 1 to 4
socket = :3031
socket = :3032
socket = :3033
socket = :3034
; map sockets to specific worker
map-socket = 1:1
map-socket = 2:2
map-socket = 3:3
map-socket = 4:4

Or more DRY:

[uwsgi]
master = true
processes = 4
socket = :3030

for = 1 2 3 4
  socket = :303%(_)
  map-socket = %(_):%(_)
endfor =


Then simply call @rpc for each of the sockets

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to