From 6afb2139dfaa499f6639d053993f0a4acd864a5f Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 16 Sep 2023 23:16:10 +0400 Subject: [PATCH 1/3] Add BlockedRelayInterface and apply it to pipes stream relay; added stream flags PING and PONG --- src/BlockedRelayInterface.php | 12 ++++++++++++ src/Frame.php | 4 +++- src/StreamRelay.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/BlockedRelayInterface.php diff --git a/src/BlockedRelayInterface.php b/src/BlockedRelayInterface.php new file mode 100644 index 0000000..c40a33e --- /dev/null +++ b/src/BlockedRelayInterface.php @@ -0,0 +1,12 @@ + Date: Tue, 3 Oct 2023 18:57:58 +0400 Subject: [PATCH 2/3] Fix psalm issues --- src/Frame.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Frame.php b/src/Frame.php index 07e8791..6ea657d 100644 --- a/src/Frame.php +++ b/src/Frame.php @@ -126,7 +126,7 @@ public static function packFrame(Frame $frame): string * @return HeaderList * @internal * - * @psalm-suppress InvalidReturnStatement, InvalidReturnType + * @psalm-suppress LessSpecificReturnStatement, MoreSpecificReturnType */ public static function readHeader(string $header): array { From f8df7b0539ee26c0ca971c12fa3e51af33afe464 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 3 Oct 2023 19:14:55 +0400 Subject: [PATCH 3/3] Rename the `BlockedRelayInterface` to BlockingRelayInterface --- src/{BlockedRelayInterface.php => BlockingRelayInterface.php} | 2 +- src/StreamRelay.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/{BlockedRelayInterface.php => BlockingRelayInterface.php} (69%) diff --git a/src/BlockedRelayInterface.php b/src/BlockingRelayInterface.php similarity index 69% rename from src/BlockedRelayInterface.php rename to src/BlockingRelayInterface.php index c40a33e..6e3088b 100644 --- a/src/BlockedRelayInterface.php +++ b/src/BlockingRelayInterface.php @@ -7,6 +7,6 @@ /** * Means that relay can't be used for non-blocking flow. */ -interface BlockedRelayInterface extends RelayInterface +interface BlockingRelayInterface extends RelayInterface { } diff --git a/src/StreamRelay.php b/src/StreamRelay.php index aee0c28..acf2094 100644 --- a/src/StreamRelay.php +++ b/src/StreamRelay.php @@ -18,7 +18,7 @@ * prefix: * [ flag ][ message length, unsigned int 64bits, LittleEndian ] */ -class StreamRelay extends Relay implements BlockedRelayInterface +class StreamRelay extends Relay implements BlockingRelayInterface { /** * @var resource