Skip to content

Commit

Permalink
Added a BeanstalkClient close() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cole Krumbholz committed Jun 28, 2011
1 parent a9f6be7 commit 9bcb6cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_beanstalkd/__init__.py
Expand Up @@ -41,6 +41,8 @@ def call(self, func, arg='', priority=DEFAULT_PRIORITY, delay=0, ttr=DEFAULT_TTR
"""
self._beanstalk.use(func)
self._beanstalk.put(str(arg), priority=priority, delay=delay, ttr=ttr)
def close(self):
self._beanstalk.close()

def __init__(self, **kwargs):
self._beanstalk = connect_beanstalkd()

1 comment on commit 9bcb6cd

@jonasvp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is strictly necessary as usually all open connections are cleaned up on quit. I'll check this and merge if necessary. Thanks for the patch!

Please sign in to comment.