I’m not seeing anything fundamentally wrong with what you have, and the test project I created to try the worker works fine for me.
Ahh… you’re using a JsonWebsocketConsumer, which means you want to use self.send_json instead of self.send. See the docs for JsonWebsocketConsumer.
Also, in the future, please post the complete error message with traceback if an error occurs. It really does help track down the cause of an issue.
Edit: When you use send_json, you pass it the actual dict - do not use json.dumps to serialize it first.