擅长:python、mysql、java
<p>当我这样做时,我没有收到任何关于更改的信息。我成功地连接到路由,但当我修改产品时,我没有从服务器收到任何到客户端的消息</p>
<p>这是我的消费者:</p>
<pre><code>class ProductConsumer(AsyncAPIConsumer):
async def accept(self, **kwargs):
await super().accept(** kwargs)
await self.model_change.subscribe()
@model_observer(Product)
async def model_change(self, message, **kwargs):
await self.send_json(message)
</code></pre>