mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 02:39:47 +02:00
Begin WebSocket support for Broadcast and Player control
This commit is contained in:
parent
2b128b122d
commit
6adf8307c4
516 changed files with 64260 additions and 18 deletions
29
modules/React/Cache/ArrayCache.php
Normal file
29
modules/React/Cache/ArrayCache.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace React\Cache;
|
||||
|
||||
use React\Promise;
|
||||
|
||||
class ArrayCache implements CacheInterface
|
||||
{
|
||||
private $data = array();
|
||||
|
||||
public function get($key)
|
||||
{
|
||||
if (!isset($this->data[$key])) {
|
||||
return Promise\reject();
|
||||
}
|
||||
|
||||
return Promise\resolve($this->data[$key]);
|
||||
}
|
||||
|
||||
public function set($key, $value)
|
||||
{
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
||||
public function remove($key)
|
||||
{
|
||||
unset($this->data[$key]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue