( )⚙ D3225 thirdparty: vendor futures 3.2.0

This is an archive of the discontinued Mercurial Phabricator instance.

thirdparty: vendor futures 3.2.0
AbandonedPublic

Authored by indygreg on Apr 10 2018, 9:26 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Python 3 has a concurrent.futures package in the standard library
for representing futures. The "futures" package on PyPI is a backport
of this package to work with Python 2.

The wire protocol code today has its own future concept for handling
of "batch" requests. The frame-based protocol will also want to
use futures.

I've heavily used the "futures" package on Python 2 in other projects
and it is pretty nice. It even has a built-in thread and process pool
for running functions in parallel. I've used this heavily for concurrent
I/O and other GIL-less activities.

The existing futures API in the wire protocol code is not as nice as
concurrent.futures. Since concurrent.futures is in the Python standard
library and will presumably be the long-term future for futres in our
code base, let's vendor the backport so we can use proper futures today.

  1. no-check-commit because of style violations

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped