Skip to content

Commit

Permalink
Merge pull request #23 from aerickson/fix_async_usage
Browse files Browse the repository at this point in the history
change all mentions of .async to .async_pool
  • Loading branch information
Richard-Mathie committed Nov 28, 2018
2 parents 170988b + 01a976e commit e191098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mailgun.send(message)

## Long Requests

A mechanisom has been put in place to simplify handling long requests. Basically if your callback function blocks the processing of an email for toolong it will cause the post from the mailgun services to timeout. At the moment this is done by setting the `mailgun.callback_handeler` to `mailgun.async_pool` but you would have to do this before registering the callbacks (you could reregister on init as well).
A mechanisom has been put in place to simplify handeling long requests. Basically if your callback function blocks the processing of an email for toolong it will cause the post from the mailgun services to timeout. At the moment this is done by setting the `mailgun.callback_handeler` to `mailgun.async_pool` but you would have to do this before registering the callbacks (you could reregister on init as well).
```python
# at config
app.config['MAILGUN_BG_PROCESSES'] = flask_mailgun.processing.async_pool(NO_PROCS)
Expand Down
2 changes: 1 addition & 1 deletion flask_mailgun/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, app=None):
if app is not None:
self.init_app(app)

def init_app(self, app):
def init_app(self, app):
self.callback_handeler = app.config.get('MAILGUN_CALLBACK_HANDELER',
sync)
self.async_pool = async_pool(app.config.get('MAILGUN_BG_PROCESSES', 4))
Expand Down

0 comments on commit e191098

Please sign in to comment.