Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 0.9.0 #131

Merged
merged 3 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

`0.9.0` (2019-12-20)
* Flask support via middleware (#127)
* Add message attributes to metrics log (#128)
* Specify number of threads per subscriber with Subscription ThreadPoolExecutor (#139)
* Publishing timeout while blocking (#137)
* Clean up rele.config.setup + Worker() init (#132)

`0.8.1` (2019-11-25)
* Fix runrele command

Expand Down
26 changes: 15 additions & 11 deletions docs/guides/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,25 @@ To configure Relé, our settings may look something like:
# Later when we setup rele and flask:
app = Flask()
rele.config.setup(RELE, flask_app=app)
```

The only major difference here is that we are using the ``rele.contrib.FlaskMiddleware`` and that we pass the flask app instance to `rele.config.setup` method.
The only major difference here is that we are using the ``rele.contrib.FlaskMiddleware`` and
that we pass the Flask ``app`` instance to ``rele.config.setup`` method.

Subscribing
____________

Now that that the middleware is setup our subscriptions will automatically have Flasks `app context https://flask.palletsprojects.com/en/1.0.x/appcontext/` pushed when they are invoked so you will have access to the database connection pool and all other app dependent utilities.
Now that that the middleware is setup our subscriptions will automatically have
`Flask's app context <https://flask.palletsprojects.com/en/1.0.x/appcontext/>`_ pushed
when they are invoked so you will have access to the database connection pool and all
other app dependent utilities.

.. code:: python
from models import File
from database import db

@sub(topic='photo-uploads')
def handle_upload(data, **kwargs):
new_file = File(data)
db.session.add(new_file)
db.session.commit()

from models import File
from database import db

@sub(topic='photo-uploads')
def handle_upload(data, **kwargs):
new_file = File(data)
db.session.add(new_file)
db.session.commit()
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Out of the box, Relé includes the following features:
* Simple publishing API
* Declarative subscribers
* Scalable Worker
* Ready to install Django integration
* Ready to install Django/Flask integration
* And much more...

What It Looks Like
Expand Down Expand Up @@ -73,6 +73,7 @@ ___________

guides/basics
guides/django
guides/flask
guides/filters
guides/emulator

Expand Down
2 changes: 1 addition & 1 deletion rele/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.8.1"
__version__ = "0.9.0"
default_app_config = "rele.apps.ReleConfig"

from .client import Publisher, Subscriber # noqa
Expand Down