mirror of
https://github.com/danog/amp.git
synced 2024-12-02 09:27:46 +01:00
Rename launch to async
Thus we've come full circle :P
This commit is contained in:
parent
31a34bcb18
commit
3926b3f978
@ -91,7 +91,7 @@ final class Future
|
||||
/**
|
||||
* @param FutureState<T> $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)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ use Revolt\EventLoop\UnsupportedFeatureException;
|
||||
*
|
||||
* @return Future<T>
|
||||
*/
|
||||
function launch(\Closure $closure): Future
|
||||
function async(\Closure $closure): Future
|
||||
{
|
||||
static $run = null;
|
||||
|
||||
|
@ -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<T>
|
||||
*/
|
||||
private function delay(float $seconds, mixed $value): Future
|
||||
{
|
||||
return launch(
|
||||
return async(
|
||||
/**
|
||||
* @return T
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user