[issue40844] Alternate ways of running coroutines

2020-06-02 Thread Yury Selivanov


Change by Yury Selivanov :


--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40844] Alternate ways of running coroutines

2020-06-02 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I'm suggesting a method on coroutines that runs them without blocking, and 
> will run a callback when it's complete.

And how would that method be implemented? Presumably the event loop would 
execute the coroutine, but that API is already there, and it's called 
create_task.  We will not be adding a builtin method for this.

You can use Task.add_done_callback() to add a callback.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40844] Alternate ways of running coroutines

2020-06-02 Thread Matthew Francis


New submission from Matthew Francis <4576fran...@gmail.com>:

Currently, using await inside a coroutine will block inside the coroutine.  
This behavior would usually be fine, but for some usecases a way to 
nonblockingly run coroutines without creating a Task could be useful, because 
tasks don't allow for a callback.  I'm suggesting a method on coroutines that 
runs them without blocking, and will run a callback when it's complete.

--
components: asyncio
messages: 370614
nosy: asvetlov, matthewfrancis, yselivanov
priority: normal
severity: normal
status: open
title: Alternate ways of running coroutines
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com