>From your experience, can you provide a brief overview of the types of 
calls that would cause a deadlock?

Maybe that's what I was experiencing earlier, but after spending today on a 
work around, I can't replicate my original problem. Both sync_to_async and 
run_in_executor work just fine right now.

On Friday, October 18, 2019 at 2:37:25 PM UTC-4, Andrew Godwin wrote:
>
> It should be fine, but you will need to be careful - there's a lot of 
> side-effects with run_in_executor you should be aware of like the way 
> exceptions propagate (Django won't handle them right for you) and the 
> possibility of deadlock.
>
> Andrew
>
> On Fri, Oct 18, 2019 at 11:27 AM BR <rac...@gmail.com <javascript:>> 
> wrote:
>
>> Should I expect any issues using asyncio run_in_executor to run blocking 
>> code? I realize there is the sync_to_async function as well, but that 
>> wasn't working in my case. I'm using multiprocessing.Queue to share data 
>> with a new process, and when I try to use queue.get() with either 
>> sync_to_async or run_in_executor, the calling method hangs.
>>
>> My solution for now was to run a queue.get() listener in a separate 
>> thread, but it would have been nicer to use await with run_in_executor. Is 
>> there any custom configuration of the consumer event loop that prevents 
>> some times of functions from running, even when run with appropriate 
>> wrapping functions?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3be88116-f199-483e-9ee9-73d3a292c81d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3be88116-f199-483e-9ee9-73d3a292c81d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d4ce7dc-2000-41e6-9de8-280769c92ddb%40googlegroups.com.

Reply via email to