Hi,
Django has get_channel_layer(), then I could use Django channel out of it. For example, I use Django to fire up a background long-time process, the process could use Django channel layer to send message to front-end with real-time.
Does Sanic has similar feature? and how?
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "services.settings")
django.setup()
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
channel_layer = get_channel_layer()
async_to_sync(channel_layer.group_send)(group, message)
Thanks.