Skip to content
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

Support Promise cancellation #40

Closed
clue opened this issue Jul 16, 2015 · 4 comments
Closed

Support Promise cancellation #40

clue opened this issue Jul 16, 2015 · 4 comments
Assignees
Milestone

Comments

@clue
Copy link
Contributor

clue commented Jul 16, 2015

We should register a Promise cancellation handler so that the following code actually cleans up the underlying socket resource:

$promise = $connector->create('reactphp.org', 80);

$promise->cancel();

This can eventually also be used as the basis for timeout support (#28), similar to this:

$promise = $connector->create('reactphp.org', 80);
$loop->addTimer(3.0, function () use ($promise) {
    $promise->cancel();
});
@clue
Copy link
Contributor Author

clue commented Sep 3, 2015

This also likely depends on reactphp/dns#28 so that the DNS request can also be canceled.

@clue
Copy link
Contributor Author

clue commented Aug 1, 2016

This also likely depends on reactphp/dns#28 so that the DNS request can also be canceled.

Available as of v0.4.3.

I'm now looking into this...

@arnaud-lb
Copy link

Any help needed on this ? :) I need this to properly timeout requests in the http-client

@clue
Copy link
Contributor Author

clue commented Nov 15, 2016

Will be resolved via #71 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants