Skip to content

Commit

Permalink
Add BlockedRelayInterface and apply it to pipes stream relay; added s…
Browse files Browse the repository at this point in the history
…tream flags PING and PONG
  • Loading branch information
roxblnfk committed Sep 16, 2023
1 parent 3f6dc5e commit 6afb213
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/BlockedRelayInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Spiral\Goridge;

/**
* Means that relay can't be used for non-blocking flow.
*/
interface BlockedRelayInterface extends RelayInterface
{
}
4 changes: 3 additions & 1 deletion src/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ final class Frame
* @var positive-int Flags for {@see $byte10}
*/
public const BYTE10_STREAM = 0x01;
public const BYTE10_STOP = 0x02; // 2.9.0-alpha just streams
public const BYTE10_STOP = 0x02;
public const BYTE10_PING = 0x04;
public const BYTE10_PONG = 0x08;

/**
* @psalm-var FrameByte10Value
Expand Down
2 changes: 1 addition & 1 deletion src/StreamRelay.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* prefix:
* [ flag ][ message length, unsigned int 64bits, LittleEndian ]
*/
class StreamRelay extends Relay
class StreamRelay extends Relay implements BlockedRelayInterface
{
/**
* @var resource
Expand Down

0 comments on commit 6afb213

Please sign in to comment.