Skip to content

Commit

Permalink
Adds grow/shrink methods to eventlet TaskPool
Browse files Browse the repository at this point in the history
  • Loading branch information
mher committed May 29, 2014
1 parent 8d4354a commit 1c60653
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions celery/concurrency/eventlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ def on_apply(self, target, args=None, kwargs=None, callback=None,
callback, accept_callback,
self.getpid)

def grow(self, n=1):
limit = self.limit + n
self._pool.resize(limit)
self.limit = limit

def shrink(self, n=1):
limit = self.limit - n
self._pool.resize(limit)
self.limit = limit

def _get_info(self):
return {
'max-concurrency': self.limit,
Expand Down

0 comments on commit 1c60653

Please sign in to comment.