Final Grant Report: Future::AsyncAwait

Future::AsyncAwait Final Report

Here is the final report by Paul Evans on his Future::AsyncAwait Grant:

This project set out to improve the Future::AsyncAwait module, fixing a number of known bugs and adding missing features. It also aimed to improve documentation and user-awareness of the new abilities that the module adds to Perl. I believe it has been successful in all of these areas.

Bugs Fixed

Of particular note, the original proposal made reference to four bugs. These have all been fixed:

In addition, many others have been found and fixed along the way. The full list can be found in the RT queue. A few bugs notable for over-average size are RT 128176, 128222, 128619 and 129215.

As the initial tasks were completed far quicker than originally estimated, I spent some of the time working on some missing features that were also in the RT queue.

The largest of these is documented by RT 123465; the integration of Perl's sub signatures with the async sub syntax. Fixing this involved some work on core perl itself to expose a new API function, parse_subsignature. This is mentioned in https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255512.html.

Another new feature was found to make integration with Syntax::Keyword::Try or other exception-catch mechanisms simpler; documented in RT 129373.

Blog Posts

Over the course of this project, I have written a number of blog posts:

I also wrote a series of posts on the Binary.com Tech Blog on the subject of how to migrate existing code structures using legacy Future or Future::Utils techniques into using async/await syntax:

I have not been able to attend a Perl conference during this project, so my plan of delivering a talk on this subject has not been achieved. I do however aim to turn my idea into another post, on a theme of how the async/await syntax makes safe concurrency by whitelisting the places where context switches can occur, rather than the more traditional approaches like mutex blocks and locking, which are more comparable to blacklisting.

Documentation

Finally, as part of the research phase several details about data structures internal to the perl interpreter were discovered, and written down in the form of some documentation that was eventually merged into the core perl tree alongside the rest of the internals documentation.

https://www.nntp.perl.org/