Popular recipes tagged "manager" but not "context"http://code.activestate.com/recipes/tags/manager-context/2012-12-17T16:19:12-08:00ActiveState Code RecipesSimple python thread manager (Python)
2012-12-17T16:19:12-08:00Tom Wissinghttp://code.activestate.com/recipes/users/4184629/http://code.activestate.com/recipes/578385-simple-python-thread-manager/
<p style="color: grey">
Python
recipe 578385
by <a href="/recipes/users/4184629/">Tom Wissing</a>
(<a href="/recipes/tags/manager/">manager</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/threading/">threading</a>, <a href="/recipes/tags/threads/">threads</a>).
</p>
<p>A simple python static class handling basic threading. Designed for "worker" threads that loop forever over a function and the like.</p>
Profile Manager (Cave Story) (Python)
2012-12-07T01:21:04-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578368-profile-manager-cave-story/
<p style="color: grey">
Python
recipe 578368
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/manager/">manager</a>, <a href="/recipes/tags/profile/">profile</a>).
</p>
<p>If you have ever played a game that only had one save slot and wanted to be able to manage profiles, the following code written for Cave Story may be of use to you. The recipe provides a starting point for how one might go about writing a profile manager for such a program that runs through a command interface.</p>
Simple python thread manager (Python)
2012-11-17T23:18:17-08:00Tino Deakhttp://code.activestate.com/recipes/users/4184300/http://code.activestate.com/recipes/578331-simple-python-thread-manager/
<p style="color: grey">
Python
recipe 578331
by <a href="/recipes/users/4184300/">Tino Deak</a>
(<a href="/recipes/tags/manager/">manager</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/threading/">threading</a>, <a href="/recipes/tags/threads/">threads</a>).
</p>
<p>A simple python static class handling basic threading. Designed for "worker" threads that loop forever over a function and the like.</p>
Distributed lock manager for Python (Python)
2012-07-04T21:03:32-07:00pavelhttp://code.activestate.com/recipes/users/4171837/http://code.activestate.com/recipes/578194-distributed-lock-manager-for-python/
<p style="color: grey">
Python
recipe 578194
by <a href="/recipes/users/4171837/">pavel</a>
(<a href="/recipes/tags/distributed/">distributed</a>, <a href="/recipes/tags/lock/">lock</a>, <a href="/recipes/tags/locking/">locking</a>, <a href="/recipes/tags/locks/">locks</a>, <a href="/recipes/tags/manager/">manager</a>, <a href="/recipes/tags/socket/">socket</a>, <a href="/recipes/tags/thread/">thread</a>, <a href="/recipes/tags/threading/">threading</a>, <a href="/recipes/tags/wsgi/">wsgi</a>).
Revision 2.
</p>
<p>Distributed lock manager provides mutex(es) over network. It is used to synchronize processes running on different machines, e.g. WSGI processes in case of web applications. Lock object is compatible with threading.Lock and can be used as a context manager ("with statement"). It can be easily modified to use UNIX sockets instead of TCP/IP. Communication protocol is text based.</p>
<p>First start server process:</p>
<pre class="prettyprint"><code>$ chmod +x dlm.py
$ ./dlm.py
</code></pre>
<p>Usage:</p>
<pre class="prettyprint"><code>from dlm import LockClient
client = LockClient('localhost', 27272, 'client_name')
lock = client.mkLock('lock_name')
lock.acquire()
# critical section here...
lock.release()
# using context manager
with lock:
# critical section here...
</code></pre>