Skip to content

Instantly share code, notes, and snippets.

@susmithagudapati
Created April 18, 2020 21:46
Show Gist options
  • Save susmithagudapati/2656e09f58dfc9dac7b2bc0cdd7cb14f to your computer and use it in GitHub Desktop.
Save susmithagudapati/2656e09f58dfc9dac7b2bc0cdd7cb14f to your computer and use it in GitHub Desktop.
from asgiref.sync import sync_to_async
async_function = sync_to_async(sync_function)
async_function = sync_to_async(sensitive_sync_function, thread_sensitive=True)
@sync_to_async
def sync_function(...):
...
@sync_to_async(thread_sensitive=True)
def sensitive_sync_function(...):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment