On Thu, Jun 14, 2012 at 5:47 AM, Roberto De Ioris <[email protected]> wrote:
>>
>> ... 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

hmm yes, that would work i think, and gives me another idea too, thanks!

so, i take it there is no generic/standard way to broadcast to the
workers ... could there be? :-)  i actually kind of like the
rpc/signal/(shmem|cache|...) method but it would be ideal if fewer
steps were needed.

aside ... are shared-sockets still only accepted by one process at a
time?  is there an established way to map a one-to-many connection?

-- 

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

Reply via email to