4 class MCRouterException extends Exception {
5 public function getKey(): string;
6 public function getOp(): int;
8 public function __construct(
10 protected int $op = MCRouter::mc_op_unknown,
11 int $reply = MCRouter::mc_res_unknown,
12 protected string $key = "",
17 class MCRouterOptionException extends Exception {
18 public function getErrors(): array<array<string,string>>;
19 public function __construct(protected array<array<string,string>> $errors);
24 public function __construct(
25 array<string,mixed> $options,
28 public static function createSimple(ConstVector<string> $servers): MCRouter;
29 public async function add(
35 public async function set(
41 public async function replace(
47 public async function prepend(string $key, string $value): Awaitable<void>;
48 public async function append(string $key, string $value): Awaitable<void>;
49 public async function incr(string $key, int $val): Awaitable<int>;
50 public async function decr(string $key, int $val): Awaitable<int>;
51 public async function del(string $key): Awaitable<void>;
52 public async function flushAll(int $delay = 0): Awaitable<void>;
53 public async function get(string $key): Awaitable<string>;
54 public async function version(): Awaitable<string>;
55 public static function getOpName(int $op): string;
56 public static function getResultName(int $op): string;
58 // From mcrouter/lib/mc/msg.h enum mc_op_e:
59 const int mc_op_unknown = 0;
60 const int mc_op_echo = 0;
61 const int mc_op_quit = 0;
62 const int mc_op_version = 0;
63 const int mc_op_servererr = 0;
64 const int mc_op_get = 0;
65 const int mc_op_set = 0;
66 const int mc_op_add = 0;
67 const int mc_op_replace = 0;
68 const int mc_op_append = 0;
69 const int mc_op_prepend = 0;
70 const int mc_op_cas = 0;
71 const int mc_op_delete = 0;
72 const int mc_op_incr = 0;
73 const int mc_op_decr = 0;
74 const int mc_op_flushall = 0;
75 const int mc_op_flushre = 0;
76 const int mc_op_stats = 0;
77 const int mc_op_verbosity = 0;
78 const int mc_op_lease_get = 0;
79 const int mc_op_lease_set = 0;
80 const int mc_op_shutdown = 0;
81 const int mc_op_end = 0;
82 const int mc_op_metaget = 0;
83 const int mc_op_exec = 0;
84 const int mc_op_gets = 0;
85 const int mc_op_get_service_info = 0;
87 // From mcrouter/lib/mc/msg.h enum mc_res_e:
88 const int mc_res_unknown = 0;
89 const int mc_res_deleted = 0;
90 const int mc_res_found = 0;
91 const int mc_res_foundstale = 0;
92 const int mc_res_notfound = 0;
93 const int mc_res_notfoundhot = 0;
94 const int mc_res_notstored = 0;
95 const int mc_res_stalestored = 0;
96 const int mc_res_ok = 0;
97 const int mc_res_stored = 0;
98 const int mc_res_exists = 0;
99 const int mc_res_ooo = 0;
100 const int mc_res_timeout = 0;
101 const int mc_res_connect_timeout = 0;
102 const int mc_res_connect_error = 0;
103 const int mc_res_busy = 0;
104 const int mc_res_try_again = 0;
105 const int mc_res_tko = 0;
106 const int mc_res_bad_command = 0;
107 const int mc_res_bad_key = 0;
108 const int mc_res_bad_flags = 0;
109 const int mc_res_bad_exptime = 0;
110 const int mc_res_bad_lease_id = 0;
111 const int mc_res_bad_cas_id = 0;
112 const int mc_res_bad_value = 0;
113 const int mc_res_aborted = 0;
114 const int mc_res_client_error = 0;
115 const int mc_res_local_error = 0;
116 const int mc_res_remote_error = 0;
117 const int mc_res_waiting = 0;