Skip to content

Commit 84dc866

Browse files
committed
Revert to Awaitable \o/
1 parent 082b89a commit 84dc866

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Whenable
1+
# Awaitable
22

33
The purpose of this proposal is to provide a common interface for simple placeholder objects returned from async operations. This will allow libraries and components from different vendors to create coroutines regardless of the library. This proposal is not designed to replace promise implementations that may be chained. Instead, this interface may be extended by promise (future, delayed) implementations.
44

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"autoload": {
1010
"psr-4": {
11-
"Interop\\Async\\Awaitable\\": "src/"
11+
"Interop\\Async\\": "src/"
1212
}
1313
}
1414
}

src/Awaitable.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Interop\Async;
4+
5+
/**
6+
* Simple interface for awaitable objects representing the future value of asynchronous operations.
7+
*/
8+
interface Awaitable
9+
{
10+
/**
11+
* Registers a callback to be invoked when the awaitable is resolved.
12+
*
13+
* @param callable(\Throwable|\Exception $exception = null, mixed $result = null) $onResolved
14+
*
15+
* @return void
16+
*/
17+
public function when(callable $onResolved);
18+
}

src/Whenable.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)