Repository navigation
Expand file tree
/
Copy pathQueue.php
More file actions
67 lines (54 loc) · 1.67 KB
/
Copy pathQueue.php
File metadata and controls
67 lines (54 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* This file is part of the tarantool/queue package.
*
* (c) Eugene Leonovich <gen.work@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Tarantool\Queue;
use Tarantool\Client\Client;
class Queue extends AbstractQueue
{
public static function fifo(Client $client, string $name) : FifoQueue
{
return new FifoQueue($client, $name);
}
public static function fifoTtl(Client $client, string $name) : FifottlQueue
{
return new FifottlQueue($client, $name);
}
public static function utube(Client $client, string $name) : UtubeQueue
{
return new UtubeQueue($client, $name);
}
public static function utubeTtl(Client $client, string $name) : UtubettlQueue
{
return new UtubettlQueue($client, $name);
}
public static function limFifoTtl(Client $client, string $name) : LimfifottlQueue
{
return new LimfifottlQueue($client, $name);
}
public static function subqueueTtl(Client $client, string $name) : SubqueuettlQueue
{
return new SubqueuettlQueue($client, $name);
}
/**
* @param array<string, mixed> $options
*/
public function put(mixed $data, array $options = []) : ?Task
{
$result = $this->call('put', $data, $options);
return empty($result[0]) ? null : Task::fromTuple($result[0]);
}
/**
* @param array<string, mixed> $options
*/
public function release(int $taskId, array $options = []) : Task
{
return Task::fromTuple($this->call('release', $taskId, $options)[0]);
}
}