defnull/bottle — pull request #571 by abingham (2014-01-21 09:49:46+00:00)
Title: Multi-phase run for WSGIRefServer

This is an initial stab at addressing issue #568 (https://github.com/defnull/bottle/issues/568). It's certainly not a complete solution, and it only works for the WSGIRefServer. What I'd like, if you have time, is some feedback on the approach.

The basic idea is that I've separated the initialization of ServerAdapters from running them. This lets users optionally access the server before it starts serving, meaning that they can e.g. find the port that's been selected for them.

There are certainly other ways we could approach this, so if you'd prefer a different implementation I'd be more than happy to try it. This is a problem I'd like to see solved.