Re: [cx-oracle-users] async
Brought to you by:
atuining
|
From: Walter <wa...@li...> - 2017-10-26 09:17:29
|
On 24 Oct 2017, at 19:57, Anthony Tuininga wrote:
> Hi Andrew,
>
> Apologies for the delay in response. I had a busy month. :-)
>
> There are no current plans to make cx_Oracle "compatible" with
> asyncio, but
> that could change -- especially if you provided some indication of
> what you
> meant by that request! It might be useful to create an issue on the
> cx_Oracle issues page providing some more details. That will give
> others a
> chance to comment a well, since not everyone is on the mailing list.
I guess this would mean that for each method that talks to the database
there should be an async version, i.e. instead of
def print_foo():
cursor.execute("select * from foo")
for row in cursor:
print(row)
we could do:
async def print_foo():
await cursor.execute("select * from foo")
async for row in cursor:
print(row)
Then we could use cx_Oracle with other async frameworks (aiohttp, sanic
and probably Tornado and Twisted and a bunch others) and take advantage
of cx_Oracle's new async features.
(We can use cx_Oracle with these frameworks now, but during any calls to
the database the code can do nothing else except wait for the answer
from the database).
Details for async/await are in PEP 492 at
https://www.python.org/dev/peps/pep-0492/
> Anthony
>
> On Mon, Sep 25, 2017 at 10:22 PM, Andrew Zyman <fo...@gm...>
> wrote:
>
>> Hello,
>> wonder if there are any plans to make the module "compatible" with
>> asyncio ?
>> Thank you
>> AZ
Servus,
Walter
|