mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
50 lines
No EOL
835 B
PHP
50 lines
No EOL
835 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Yggverse\Yoda\Interface\Model;
|
|
|
|
/*
|
|
* Shared memory API for async operations
|
|
*
|
|
*/
|
|
interface Pool
|
|
{
|
|
public function __construct(
|
|
?string $namespace = null
|
|
);
|
|
|
|
public function init(
|
|
string $key,
|
|
int $size = 0xfffff,
|
|
string $flags = 'c',
|
|
int $mode = 0644,
|
|
): ?\Shmop;
|
|
|
|
public function read(
|
|
string $key,
|
|
int $start = 0,
|
|
int $count = 0
|
|
): ?string;
|
|
|
|
public function write(
|
|
string $key,
|
|
string $value,
|
|
int $offset = 0
|
|
): int;
|
|
|
|
public function delete(
|
|
string $key
|
|
): bool;
|
|
|
|
public function get(
|
|
string $key
|
|
): string;
|
|
|
|
public function set(
|
|
string $key,
|
|
?string $value = null
|
|
): void;
|
|
|
|
public function reset(): void;
|
|
} |