From 3926b3f978d3492f76c7feb46044acec77d8a17e Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Thu, 2 Dec 2021 13:44:10 -0600 Subject: [PATCH] Rename launch to async Thus we've come full circle :P --- src/Future.php | 2 +- src/functions.php | 2 +- test/Future/FutureTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Future.php b/src/Future.php index d12e104..b07772a 100644 --- a/src/Future.php +++ b/src/Future.php @@ -91,7 +91,7 @@ final class Future /** * @param FutureState $state * - * @internal Use {@see Deferred} or {@see launch()} to create and resolve a Future. + * @internal Use {@see Deferred} or {@see async()} to create and resolve a Future. */ public function __construct(FutureState $state) { diff --git a/src/functions.php b/src/functions.php index b5d7304..c2cfe72 100644 --- a/src/functions.php +++ b/src/functions.php @@ -16,7 +16,7 @@ use Revolt\EventLoop\UnsupportedFeatureException; * * @return Future */ -function launch(\Closure $closure): Future +function async(\Closure $closure): Future { static $run = null; diff --git a/test/Future/FutureTest.php b/test/Future/FutureTest.php index 1b5699a..692baab 100644 --- a/test/Future/FutureTest.php +++ b/test/Future/FutureTest.php @@ -11,8 +11,8 @@ use Amp\PHPUnit\LoopCaughtException; use Amp\PHPUnit\TestException; use Amp\TimeoutCancellationToken; use Revolt\EventLoop; +use function Amp\async; use function Amp\delay; -use function Amp\launch; class FutureTest extends AsyncTestCase { @@ -319,13 +319,13 @@ class FutureTest extends AsyncTestCase * @template T * * @param float $seconds - * @param T $value + * @param T $value * * @return Future */ private function delay(float $seconds, mixed $value): Future { - return launch( + return async( /** * @return T */