mirror of
https://github.com/danog/parallel.git
synced 2024-12-02 17:52:14 +01:00
3d5e1c6e6f
Remove \Countable, add tests.
37 lines
785 B
PHP
37 lines
785 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel\Worker;
|
|
|
|
interface Environment extends \ArrayAccess {
|
|
/**
|
|
* @param string $key
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function exists(string $key);
|
|
|
|
/**
|
|
* @param string $key
|
|
*
|
|
* @return mixed|null Returns null if the key does not exist.
|
|
*/
|
|
public function get(string $key);
|
|
|
|
/**
|
|
* @param string $key
|
|
* @param mixed $value Using null for the value deletes the key.
|
|
* @param int $ttl Number of seconds until data is automatically deleted. Use 0 for unlimited TTL.
|
|
*/
|
|
public function set(string $key, $value, int $ttl = null);
|
|
|
|
/**
|
|
* @param string $key
|
|
*/
|
|
public function delete(string $key);
|
|
|
|
/**
|
|
* Removes all values.
|
|
*/
|
|
public function clear();
|
|
}
|