-
Notifications
You must be signed in to change notification settings - Fork 9
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
Composer: Add API virtual package and require an implementation #136
Composer: Add API virtual package and require an implementation #136
Conversation
We could also move |
We'd then have the issue of people having to specify dual requirements (api and implementation) in their libs. |
I don't think people really need to specify the |
Personally, I agree. I think the implementation requirement will only be needed in certain packages. I think if we're all happy with that then it would make sense to move |
Which ones? |
Ones like Guzzle which might use a loop but hide that fact from applications. |
We don't care about such packages here. Every package that hides the loop isn't interoperable. |
When I say hide the loop, I mean by implementing functionality which implicitly runs the loop and awaits promise resolution instead of requiring clients to bootstrap and run the loop themselves, such as how Guzzle does with its awaitable promises. This is useful in synchronous applications. |
Anyway, I'm happy to make this a suggest if everyone else is. |
@joshdifabio I know what you mean and IMO this is not implementable in a interop way, because it blocks then. |
Moving |
Okay, I'm gonna move it to suggest. |
@@ -15,6 +14,9 @@ | |||
"provide": { | |||
"async-interop/event-loop-api": "0.1" | |||
}, | |||
"suggest": { | |||
"async-interop/event-loop-implementation": "A loop implementation is needed in order to run the loop." |
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.
Suggestion: "A loop implementation is required in order to run a loop."
I should squash commits before this gets merged. |
@joshdifabio What's still missing is a note in the README about libraries only depending on |
Right. Is someone working on a proper readme & metadoc? |
@bwoebi Wanted to do that, don't know whether he started yet. But in the meantime, a note in the README is fine I guess. |
I just noticed that the |
While we might want to add a new method somewhere in the future, I think the proposed ways are too complicated and aren't worth the trouble, we should just increase the major version in case we need to add a method. I think it's unlikely to happen after 1.0 is out. |
I think we should just go with #151 and then we don't need anything like this. |
As long as we allow others to define their own drivers #151 doesn't actually change anything. We would still need to provide some kind of semantic version guarantee to both loop users and loop implementors. The question is still whether we would want to bump the major version for loop users when we change the driver in a way which only breaks implementations. I don't think this PR represents any real complexity, but it gives loop users the power to opt-in to non-breaking API changes to the driver interface. I think that's worth the single |
What's the proposal for libraries to depend on after #151 is merged? |
If I understand the question, I see three options:
I think 3 would be my preferred approach. |
Closing, as project discontinued for now. |
Resolves #129.
There's a potential issue here: Travis is now going to require a compatible
event-loop-implementation
in order to run the tests forevent-loop
. To solve this, perhaps we could create anevent-loop-dummy-implementation
repo inasync-interop
, not add it to Packagist so it's not pulled in elsewhere, movetests\DummyDriver.php
to that new repo, and add the following to theevent-loop
composer.json file:Thoughts?