I have servers that send a sequence of PNG images which need to be processed 
via a sequence of commands. 

My idea is this:

A Python websockets server is listening for connections from the servers. When 
a websocket connection is received, a new Python process is spawned - 
presumably using https://docs.python.org/3/library/multiprocessing.html and 
somehow the websocket is given to that process (how?).  The spawned process 
listens to the websocket, receives the PNG images and then processes them.  
After completion, the spawned process dies and the websocket is closed. So the 
spawned Python processes might run for up to a few minutes each.

Is this a workable idea in Python? 

One open question is how would I hand the websocket to the spawned process?

Also, coud such an approach support tens, hundreds, thousands of connections on 
a for example 8 core machine with 16 gig RAM ( know this is how long is a piece 
of string, but just finger in the air guessing to make sure there’s no huge 
gotcha in there that would impose a huge constraint & invalidate the idea)?

I was looking at this gist as inspiration for a start point 
https://gist.github.com/gdamjan/d7333a4d9069af96fa4d

Any ideas/feedback valued.

thanks

Andrew
_______________________________________________
melbourne-pug mailing list
melbourne-pug@python.org
https://mail.python.org/mailman/listinfo/melbourne-pug

Reply via email to