On 12/26/2018 08:10 AM, Mark Zealey via RT wrote:
Show quoted text> Wed Dec 26 02:10:34 2018: Request 128104 was acted upon.
> Transaction: Ticket created by mark@markandruth.co.uk
> Queue: DBIx-Class
> Subject: Async support integration
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: mark@markandruth.co.uk
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=128104 >
>
>
> Hi there, I've been working on integrating support for async queries
> into DBIx::Class using event loops. It is actually pretty non-invasive
> and I have it working for cursors at the moment. But I need to split out
> some core functionality like ResultSet::_construct_results so that the
> fetch of rows and the construction of results are separate functions. Is
> a PR like this likely to be merged into core reasonably easily or should
> I look to create a standalone distribution with async-specific
> subclassing of ResultSet etc containing split copies of the key functions?
>
Hi!
Thanks for your interest in trying to patch in some async stuf. The
short answer to your question is "it depends": the way the question is
phrased makes me think that you are *not* on the right track -
_construct_resuls is already 100% CPU bound and is separated from the
fetched via the ::Cursor mechanism.
We could try to duke out the details in this ticket, or alternatively if
you prefer the velocity you can put together a different
::ResultSet-based subclass as a proof of concept and then we see which
hooks are necessary to provide so that as much of the functionality is
incorporated into DBIC itself while at the same time keeping DBIC 100%
synchronous in its core dist.
An extra piece that *may* be useful to you is this gist I put together
way back when ( the most important implementation-blueprint is at the
very very end from line 451 onward):
https://gist.github.com/ribasushi/032fbb8b58e2b0d62fae
Let me know how I can help further!