[squeak-dev] Re: [OT] Perl or Python to start an image?

Chris Cunnington smalltalktelevision at gmail.com
Thu Jan 24 03:12:40 UTC 2013


On 2013-01-23 9:07 PM, Colin Putney wrote:
> For DabbleDB we wrote a ruby program to do this—each server had a few 
> thousand images, each configured to run Seaside on a particular port. 
> When a request came in for that image, the ruby program would look up 
> the port, see if the image was running, and if not, start it, then 
> rewrite the request URL so that it would get proxied through to the 
> image. The images would automatically shut down if they didn't receive 
> any requests for a while.
>
That's exactly what I'm riffing on. Thank you Ramon Leon for outlining 
how DabbleDB did it. [1]

And after going to the gym, I've realized I forgot the 
sys.stdout.flush() required after print to actually turn off buffering 
in the Python script. Otherwise the two processes sharing an anonymous 
pipe will deadlock waiting forever for the other to send something. 
("Programming Python", p. 224)

It's almost there. Just airing the problem actually does a lot of good. 
I'll sleep on it and it'll be clearer tomorrow.

Thanks,
Chris


[1] 
http://onsmalltalk.com/scaling-seaside-more-advanced-load-balancing-and-publishing


More information about the Squeak-dev mailing list