Django 通道在组发送之间休眠

问题描述

我想要实现的目标非常简单,因为您可以在标题中阅读,但我无法让它“在两次发送之间休眠”。 我的代码

        await self.channel_layer.group_send(
        str(self.game_link),{
            "type": "group_message","text": json.dumps(answer_data),}
        )

        await asyncio.sleep(5)

        await self.channel_layer.group_send(
        str(self.game_link),"text": json.dumps(data),}
        )

这里发生的是在睡眠完成后两者同时发送。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)