-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAdapter.php
More file actions
43 lines (36 loc) · 941 Bytes
/
Adapter.php
File metadata and controls
43 lines (36 loc) · 941 Bytes
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
<?php
namespace Utopia\Queue;
abstract class Adapter
{
public int $workerNum;
public Queue $queue;
public string $namespace;
public Consumer $consumer;
public function __construct(int $workerNum, string $queue, string $namespace = 'utopia-queue')
{
$this->workerNum = $workerNum;
$this->queue = new Queue($queue, $namespace);
}
/**
* Starts the Server.
* @return self
*/
abstract public function start(): self;
/**
* Stops the Server.
* @return self
*/
abstract public function stop(): self;
/**
* Is called when a Worker starts.
* @param callable $callback
* @return self
*/
abstract public function workerStart(callable $callback): self;
/**
* Is called when a Worker stops.
* @param callable $callback
* @return self
*/
abstract public function workerStop(callable $callback): self;
}