django-unicorn
django-unicorn copied to clipboard
Investigate using async view for message endpoint
Once Django 3.1 and async views are available, see how hard it would be to use an async view if configured.
@adamghill Do you have any news about using async views with Unicorn ?
is there any update to using async? Especially using it in the actions. I tried it and it's throwing an error as you might already know. I am using 0.52.0
I haven't looked into async other than the initial commit above to set up a way to prototype it. Can you create a PR with an initial use case? That would give me a good starting place.
it's pretty straight forward to set up actually. Just have an async action like so:
from asyncio import sleep
async def submit_form(self):
sleep(3)
self.text = 'done'
right now, we can actually make it work by decorating it using async_to_sync decorator