1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-02 17:52:14 +01:00
parallel/lib/Worker/Environment.php

38 lines
794 B
PHP
Raw Normal View History

2016-12-30 02:16:04 +01:00
<?php
2015-09-10 06:29:41 +02:00
2016-08-23 23:47:40 +02:00
namespace Amp\Parallel\Worker;
2015-09-10 06:29:41 +02:00
2018-10-07 16:50:45 +02:00
interface Environment extends \ArrayAccess
{
2015-09-10 06:29:41 +02:00
/**
* @param string $key
*
* @return bool
*/
2018-10-25 16:38:38 +02:00
public function exists(string $key): bool;
2015-09-10 06:29:41 +02:00
/**
* @param string $key
*
2015-09-11 01:37:34 +02:00
* @return mixed|null Returns null if the key does not exist.
2015-09-10 06:29:41 +02:00
*/
2016-01-23 07:00:56 +01:00
public function get(string $key);
2015-09-10 06:29:41 +02:00
/**
* @param string $key
2015-09-11 01:37:34 +02:00
* @param mixed $value Using null for the value deletes the key.
2020-02-04 17:10:02 +01:00
* @param int $ttl Number of seconds until data is automatically deleted. Use null for unlimited TTL.
2015-09-10 06:29:41 +02:00
*/
public function set(string $key, $value, int $ttl = null);
2015-09-11 01:37:34 +02:00
/**
* @param string $key
*/
2016-01-23 07:00:56 +01:00
public function delete(string $key);
2015-09-11 01:37:34 +02:00
/**
* Removes all values.
*/
2016-01-15 00:44:43 +01:00
public function clear();
2015-09-10 06:29:41 +02:00
}