Skip to content

Commit

Permalink
Annotate CancelledException correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed May 30, 2019
1 parent 3c136d2 commit 864fea2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Amp\Socket;

use Amp\CancellationToken;
use Amp\CancelledException;
use Amp\Promise;

interface Connector
Expand All @@ -17,6 +18,7 @@ interface Connector
* @return Promise<EncryptableSocket>
*
* @throws ConnectException
* @throws CancelledException
*/
public function connect(
string $uri,
Expand Down
2 changes: 2 additions & 0 deletions src/SocketPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Amp\Socket;

use Amp\CancellationToken;
use Amp\CancelledException;
use Amp\Promise;

/**
Expand All @@ -28,6 +29,7 @@ interface SocketPool
* @return Promise<EncryptableSocket> Resolves to an EncryptableSocket instance once a connection is available.
*
* @throws SocketException
* @throws CancelledException
*/
public function checkout(
string $uri,
Expand Down
2 changes: 2 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Amp\Socket;

use Amp\CancellationToken;
use Amp\CancelledException;
use Amp\Loop;
use Amp\Promise;

Expand Down Expand Up @@ -112,6 +113,7 @@ function connector(Connector $connector = null): Connector
* @return Promise<EncryptableSocket>
*
* @throws ConnectException
* @throws CancelledException
*/
function connect(string $uri, ConnectContext $context = null, CancellationToken $token = null): Promise
{
Expand Down

0 comments on commit 864fea2

Please sign in to comment.