Page MenuHomePhabricator

Introduce "FuturePool" to make it easier to manage an ongoing pool of futures
ClosedPublic

Authored by epriestley on Apr 3 2020, 6:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 10:44 PM
Unknown Object (File)
Sat, Apr 20, 5:09 PM
Unknown Object (File)
Wed, Apr 10, 1:58 AM
Unknown Object (File)
Fri, Apr 5, 9:25 PM
Unknown Object (File)
Sat, Mar 30, 9:09 AM
Unknown Object (File)
Mar 10 2024, 4:10 PM
Unknown Object (File)
Feb 19 2024, 10:34 AM
Unknown Object (File)
Feb 3 2024, 11:53 PM
Subscribers
None

Details

Summary

Ref T11968. "FutureIterator" recently became non-rewindable, and starting a Future twice is now an error.

This complicates a handful of use cases where a mostly-constant pool of futures is maintained over a long period of time, notably in daemon overseers and repository pull daemons.

They previously relied on being able to do "new FutureIterator($futures)" to continue resolution of a list of futures from any state. This no longer works quite like it used to, since Futures generally may not belong to more than one iterator now (and this property is desirable).

Introduce "FuturePool", which maintains exactly one iterator but manages the small amount of glue around adding and removing Futures from it, destroying it if the pool empties, and rebuilding it if the pool fills.

Test Plan

See next change, which makes use of this.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable