/
.nsq.php
85 lines (70 loc) · 1.86 KB
/
.nsq.php
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
# This file required for syntax highlighting of the php-nsq extension
namespace {
const NSQ_ERROR_NONE = 0;
const NSQ_ERROR_NO_CONNECTION = 1;
const NSQ_ERROR_UNABLE_TO_PUBLISH_MESSAGE = 2;
const NSQ_ERROR_TOPIC_KEY_REQUIRED = 3;
const NSQ_ERROR_CHANNEL_KEY_REQUIRED = 4;
const NSQ_ERROR_LOOKUPD_SERVER_NOT_AVAILABLE = 5;
const NSQ_ERROR_PUB_LOST_CONNECTION = 6;
const NSQ_ERROR_TOPIC_NOT_EXISTS = 7;
const NSQ_ERROR_CALLBACK_FUNCTION_IS_NOT_CALLABLE = 8;
const NSQ_ERROR_LIBEVENT_COULD_NOT_BE_INITIALIZED = 9;
const NSQ_ERROR_CONNECTION_FAILED = 10;
class Nsq
{
public $nsqConfig;
public $nsqd_connection_fds;
public $conn_timeout;
public function __construct(array $nsq_config = [])
{
}
/** @return bool */
public function connectNsqd($connectaddr_arr)
{
}
/** @return bool */
public function closeNsqdConnection()
{
}
/** @return bool */
public function publish($topic, $msg)
{
}
/** @return bool */
public function deferredPublish($topic, $msg, $delay_time)
{
}
public function subscribe($nsq_lookupd, $config, $callback)
{
}
}
class NsqLookupd
{
public $address;
public function __construct(string $lookup_address)
{
}
}
class NsqMessage
{
public $message_id;
public $messageId;
public $timestamp;
public $attempts;
public $payload;
public function touch($bev_zval, $message_id)
{
}
public function requeue($bev_zval, $message_id, $time_ms)
{
}
public function finish($bev_zval, $message_id)
{
}
}
class NsqException extends \Exception
{
}
}