This commit is contained in:
2021-02-26 00:59:52 +03:00
committed by GitHub
parent 9cefa847a9
commit e670cb161c
54 changed files with 1410 additions and 1280 deletions

32
src/Frame.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Nsq;
abstract class Frame
{
public const TYPE_RESPONSE = 0,
TYPE_ERROR = 1,
TYPE_MESSAGE = 2
;
public function __construct(public int $type)
{
}
public function response(): bool
{
return self::TYPE_RESPONSE === $this->type;
}
public function error(): bool
{
return self::TYPE_ERROR === $this->type;
}
public function message(): bool
{
return self::TYPE_MESSAGE === $this->type;
}
}