Django Channels 2 Group_send to channel layer causes runtime error: "got Future attached to a different loop"

2018-02-16 Thread Luke Hebert
Trying to call a consumer method inside a SyncConsumer class def alert_receive(self, event): # Get a message of the alert.receive type off of channel_layers content = json.dumps("Group send working") self.send({ "type":"websocket.send",#

Django Channels 2 Group_send to channel layer causes runtime error: "got Future attached to a different loop"

2018-02-16 Thread Luke Hebert
Trying to call the "alert_receive" consumer method import json from channels.consumer import SyncConsumer from channels.exceptions import StopConsumer from asgiref.sync import async_to_sync from channels.layers import get_channel_layer class ClientAlertPtrConsumer(SyncConsumer): def websocke