Skip to content

Support Promise cancellation #40

Closed
@clue

Description

@clue

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();
});

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions