"Ian Kelly" wrote in message
news:CALwzidkr-fT6S6wH2caNaxyQvUdAw=x7xdqkqofnrrwzwnj...@mail.gmail.com...
On Wed, Jan 27, 2016 at 10:14 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> Unfortunately this doesn't actually work at present.
> EventLoop.run_in_executor swallows the StopIteration exception and
> just returns None, which I assume is a bug.
http://bugs.python.org/issue26221
Thanks for that. Fascinating discussion between you and GvR.
Reading it gave me an idea.
Run the database handler in a separate thread. Use a queue.Queue to send
requests to the handler. Use an asyncio.Queue to send results back to the
caller, which can call 'await q.get()'.
I ran a quick test and it seems to work. What do you think?
Frank
--
https://mail.python.org/mailman/listinfo/python-list