djangosnippets.org: Latest snippets tagged with 'twisted'https://djangosnippets.org/tags/twisted/2013-06-28T01:48:51.902847-05:00Multi-DB Reconnecting Persistent Postgres Connection
2013-06-28T01:48:51.902847-05:00cronosahttps://djangosnippets.org/snippets/2965/<p>This is a modification of http://djangosnippets.org/snippets/1707/ that handles the database going down or PG Bouncer killing the connection. This also works in things like Twisted to make sure the connection is alive before doing a real query. Thanks @mike_tk for the original post!</p>
<p>EDIT: Updated the wrapper to handle multi-db. …</p>
Freely redistributableSimple twisted replacement for runserver
2010-10-21T23:18:51.174921-05:00tomfmasonhttps://djangosnippets.org/snippets/2238/<p>This is an extremely simple example but from here the possibilities are almost endless :)
</p>
Freely redistributableTwisted protocol for receiving logging module messages over a socket
2008-10-08T10:30:33.166434-05:00afternoonhttps://djangosnippets.org/snippets/1116/<p>When using Python's logging module in a concurrent environment (e.g. mod_python), messages get dropped by the standard file-based handlers. The <a href="http://www.python.org/doc/2.5.2/lib/node414.html">SocketHandler</a> allows you to send logging messages to a remote socket. This snippet provides code for listening for such messages and writing them out to a log file. The final …</p>
Freely redistributable