async def observer_orm_notify(self, message):
        """Process notification from ORM."""

        @database_sync_to_async
        def get_observers(table):
            # Find all observers with dependencies on the given table.
            return list(
                Observer.objects.filter(
                    dependencies__table=table, subscribers__isnull=False
                )
                .distinct('pk')
                .values_list('pk', flat=True)
            )

        observers_ids = await get_observers(message['table'])

        for observer_id in observers_ids:
            await self.channel_layer.send(
                CHANNEL_WORKER, {'type': TYPE_EVALUATE, 'observer': observer_id}
            )
async def observer_orm_notify ( self , message ) : @ database_sync_to_async def get_observers ( table ) : return list ( Observer . objects . filter ( dependencies__table = table , subscribers__isnull = False ) . distinct ( 'pk' ) . values_list ( 'pk' , flat = True ) ) observers_ids = await get_observers ( message [ 'table' ] ) for observer_id in observers_ids : await self . channel_layer . send ( CHANNEL_WORKER , { 'type' : TYPE_EVALUATE , 'observer' : observer_id } )
Process notification from ORM.