Skip to content

Conversation

@kelunik
Copy link
Member

@kelunik kelunik commented May 17, 2016

Please read it and submit any feedback here or submit an issue for larger issues.

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.
Copy link
Contributor

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 Awaitable can never an Awaitable.

Thus, the value of an Awaitable can never be an Awaitable. ❓

Copy link
Member Author

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.
Copy link

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

@jsor
Copy link

jsor commented May 17, 2016

I noticed a mixed usage of the terms parameters and arguments for function arguments. Should probably made consistent.

@jsor
Copy link

jsor commented May 17, 2016

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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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

@kelunik
Copy link
Member Author

kelunik commented May 18, 2016

Merging, all issues should be created as issues to keep things clean.

@kelunik kelunik merged commit 06fd353 into async-interop:master May 18, 2016
@kelunik kelunik deleted the spec branch May 18, 2016 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants