-
Notifications
You must be signed in to change notification settings - Fork 3
Specification #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
README.md
Outdated
| 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 rethrown in a callable passed to `Loop::defer` so `Loop::onError` can be properly invoked by the loop. `Loop` refers to the [global event loop accessor](https://github.com/async-interop/event-loop/blob/master/src/Loop.php). The `Awaitable` implementation MUST then continue to call the remaining callbacks with the original reason. | ||
|
|
||
| If an `Awaitable` is resolved with another `Awaitable`, the `Awaitable` MUST keep in pending state until the passed `Awaitable` is resolved. Thus, the value of an `Awaitable` can never an `Awaitable`. An `Awaitable` MUST NOT be resolved with itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thus, the value of an
Awaitablecan never anAwaitable.
Thus, the value of an Awaitable can never be an Awaitable. ❓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
README.md
Outdated
| # Awaitable | ||
|
|
||
| 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. | ||
| 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 used placeholder implementation. This proposal is not designed to replace promise implementations that may be chained. Instead, this interface may be extended by promise implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...regardless of the used placeholder implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
|
I noticed a mixed usage of the terms |
|
Ignore my last comment, i've misread it. |
| |`succeeded`| <ul><li>MUST NOT transition to any other state.</li><li>MUST have a value which MUST NOT change.*</li></ul> | | ||
| |`failed` | <ul><li>MUST NOT transition to any other state.</li><li>MUST have a reason which MUST NOT change.*</li></ul> | | ||
|
|
||
| * _Must not change_ refers to the _reference_ being immutable in case of an object, _not the object itself_ being immutable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May you please clarify what you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know what's unclear. Once resolved, the values can't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh… these references and you are referring to the value.
I was confused as I read it as in case of the Awaitable being an object and was totally WTF.
And I've read reference as in &$byRef ... just confusing me more.
Also, you need to consider references (real ones as in &$byRef) inside arrays for example which are not covered, if you're going to be that explicit.
I don't know how to phrase it better currently, perhaps you have an idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think &$byRef is covered by the reference must not change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd perhaps say a value which MUST NOT change between callback calls and drop the * part, which is just confusing, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bwoebi But the value can change if it's an object which is not immutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With value in PHP is always meant whatever gets actually copied upon assignment. (For scalars, it's all data, for arrays too, for objects just the handle as for references.)
Is there any word which properly describes it concisely? \cc @DaveRandom
|
Merging, all issues should be created as issues to keep things clean. |
Please read it and submit any feedback here or submit an issue for larger issues.