Latest recipes tagged "task"http://code.activestate.com/recipes/tags/task/new/2017-02-06T18:30:18-08:00ActiveState Code RecipesLong processing computation in Tkinter or long-running task (Python) 2017-02-06T18:30:18-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580754-long-processing-computation-in-tkinter-or-long-run/ <p style="color: grey"> Python recipe 580754 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/computation/">computation</a>, <a href="/recipes/tags/intensive/">intensive</a>, <a href="/recipes/tags/long/">long</a>, <a href="/recipes/tags/task/">task</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 12. </p> <p>I provide in this module the function "tk_call_async": It executes a function asynchronously.</p> <pre class="prettyprint"><code>tk_call_async(window, computation, args=(), kwargs={}, callback=None, polling=100, method=MULTIPROCESSING) </code></pre> <p>"tk_call_async" executes the function "computation" asynchronously with the provided "args" and "kwargs" without blocking the tkinter event loop.</p> <p>If "callback" is provided, it will be called with the result when the computation is finished.</p> <p>If an exception happens doing the computation, the errback function is called with the exception if this is provided.</p> <p>"Polling" will be the frequency to poll to check for results.</p> <p>There is two methods to execute the task: using multiprocessing or using threads.</p> Cron-like Triggers (Python) 2010-12-07T22:52:10-08:00Eric Pruitthttp://code.activestate.com/recipes/users/4170757/http://code.activestate.com/recipes/577466-cron-like-triggers/ <p style="color: grey"> Python recipe 577466 by <a href="/recipes/users/4170757/">Eric Pruitt</a> (<a href="/recipes/tags/anacron/">anacron</a>, <a href="/recipes/tags/cron/">cron</a>, <a href="/recipes/tags/job/">job</a>, <a href="/recipes/tags/scheduler/">scheduler</a>, <a href="/recipes/tags/task/">task</a>). Revision 4. </p> <p>This module provides an easy to use interface for cron-like task scheduling. The latest version and its unit tests can be found at <a href="https://github.com/jameseric/cronex">github</a>.</p> Simple MultiThreaded Timer Job Controller (Python) 2009-05-11T02:05:16-07:00sumerchttp://code.activestate.com/recipes/users/4170198/http://code.activestate.com/recipes/576748-simple-multithreaded-timer-job-controller/ <p style="color: grey"> Python recipe 576748 by <a href="/recipes/users/4170198/">sumerc</a> (<a href="/recipes/tags/job/">job</a>, <a href="/recipes/tags/multithread/">multithread</a>, <a href="/recipes/tags/task/">task</a>, <a href="/recipes/tags/timer/">timer</a>). Revision 2. </p> <p>We have tried to write an audit for our server to check our server's connection, status and other internal info and there are multiple threads invoking multiple tasks. So I came up with this simple utility that takes a job and runs it in a specific interval.</p>