I'm the developer of async and also working on async-mysql. It's a little bit similar to EventMachine but uses fibers.
I've been trying to make mysql2 work well with async. async_result is okay except it appears it could still block internally when reading large result sets.
So, I wanted to try streaming to improve the situation..
I wish there was an API like Result#next which returned the next rows without requiring to call #each with a block.
I wish there was a was some way to tell if the next call to Result#next would block on network I/O. e.g. Result#available?.
Ideally, I can write something like this:
client.query(sql, async: true, stream: true, **options)
wait_readable
result = client.async_result
# Read one row:
wait_readable unless result.available?
return result.next
I'm the developer of
async
and also working onasync-mysql
. It's a little bit similar to EventMachine but uses fibers.I've been trying to make
mysql2
work well with async.async_result
is okay except it appears it could still block internally when reading large result sets.So, I wanted to try streaming to improve the situation..
I wish there was an API like
Result#next
which returned the next rows without requiring to call#each
with a block.I wish there was a was some way to tell if the next call to
Result#next
would block on network I/O. e.g.Result#available?
.Ideally, I can write something like this:
Do you think something like this is possible?