I recently had to handle a case where I needed to be able to refresh a Python module's imports on the fly. The case is for working with Twitter Streams. When new code is deployed that affects the scraping module, I want to be able to restart the stream as fast as humanly possible in order to minimize the lost of tweets. Twitter suggests firing up a new stream first and then killing the second one in order to prevent any interruptions, but for all intents and purposes this is close enough.
Turns out ... Read More