Skip to content

Commit b2bbbda

Browse files
authored
Merge pull request #24 from async-interop/issue-16
Remove responsibility mixup
2 parents 3ce33f0 + 93f4124 commit b2bbbda

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

META.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ Additionally, coroutines do not use the returned `Promise` of a `then` callback,
2222

2323
## Creation of Promises
2424

25-
Promise creation and managing is out of scope of this specification, as managing never shall cross library boundaries and thus does not need to be interoperable at all; each library shall resolve the Promise it created itself.
25+
`Promise` creation and managing is out of scope of this specification, as managing never shall cross library boundaries and thus does not need to be interoperable at all. Each library shall resolve the `Promise` it created itself.
26+
27+
## Resolution of Promises
28+
29+
The specification defines that the value of a `Promise` must never be another `Promise`. Implementations may still accept to be resolved by a promise and then defer the resolution until the passed promise resolves.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For further design explanations and notes, please refer to [the meta document](M
1919
## Terminology
2020

2121
1. _Promise_ is an object implementing `Interop\Async\Promise` and conforming to this specification.
22-
2. _Value_ is any legal PHP value (including `null`), except an instance of `Interop\Async\Promise`.
22+
2. _Value_ is any legal PHP value (including `null`), but not an instance of `Interop\Async\Promise`.
2323
3. _Error_ is any value that can be thrown using the `throw` statement.
2424
4. _Reason_ is an error indicating why a `Promise` has failed.
2525

@@ -74,8 +74,6 @@ Any implementation MUST at least provide these two parameters. The implementatio
7474
7575
All registered callbacks MUST be executed in the order they were registered. If one of the callbacks throws an `Exception` or `Throwable`, it MUST be forwarded to `Async\Interop\Promise\ErrorHandler::notify`. The `Promise` implementation MUST then continue to call the remaining callbacks with the original parameters.
7676

77-
If a `Promise` is resolved with another `Promise`, the `Promise` MUST keep in pending state until the passed `Promise` is resolved. Thus, the value of a `Promise` can never be a `Promise`.
78-
7977
## Contributors
8078

8179
* [Aaron Piotrowski](https://github.com/trowski)

0 commit comments

Comments
 (0)