Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 1dc4c80

Browse files
committed
django: utils: add sync function for sending rpc notifications
Signed-off-by: Florian Scherf <f.scherf@pengutronix.de>
1 parent 9d62151 commit 1dc4c80

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

aiohttp_json_rpc/django/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from functools import partial
2+
3+
4+
def notify(request, topic, data=None, state=False, wait=False):
5+
return request.environ['aiohttp.request'].app['rpc'].worker_pool.run_sync(
6+
partial(request.environ['aiohttp.request'].app['rpc'].notify,
7+
topic, data, state=state),
8+
wait=wait,
9+
)

0 commit comments

Comments
 (0)