This commit is contained in:
j3d1 2024-06-26 18:42:56 +02:00
parent 242066ada4
commit ec3579e7c1
36 changed files with 1029 additions and 18 deletions

View file

@ -0,0 +1,21 @@
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
def notify_sessions(event, data):
def wrapper(func):
def wrapped(*args, **kwargs):
ret = func(*args, **kwargs)
channel_layer = get_channel_layer()
async_to_sync(channel_layer.group_send)(
event,
{
'type': 'notify',
'data': data,
}
)
return ret
return wrapped
return wrapper