You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/features/proxy/api-reference.md
+11-19Lines changed: 11 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -14,34 +14,26 @@ At this stage API functions are mostly stable, but are still subject to
14
14
occasional change. Most changes in functionality will be either additions or
15
15
with a backwards-compatible deprecation cycle.
16
16
17
-
After 1.6.23, we do not expect major core changes to the API. We will stick to
18
-
incremental improvements.
19
-
20
17
## Features
21
18
22
19
* Supports most of the text and meta protocols
23
20
* Dynamically configured backend pools and route handling
24
21
* Pluggable key distribution hashing algorithms
25
22
* Reduces connections to backend servers
26
-
* Use of Lua coroutines allows procedural programming style
27
-
* Able to selectively override commands, or serve from memcached embedded in
23
+
* Able to selectively override commands, or serve data from memcached embedded in
28
24
the proxy
29
25
* Design routes to precisely fit your needs via simple Lua
26
+
* Use TLS to connect to memcached backends
30
27
* Flexible topologies: Run as a sidecar client, a large border proxy, or
31
28
directly on an existing pool of servers
32
-
* Fast: all performance critical code is still C. Minimal Lua is executed for
33
-
routing requests to backends.
34
-
35
-
Roadmapped features:
36
-
* Expanded API for manipulating request data easily
37
-
* TLS support for backend connections (frontend TLS is already supported)
38
-
29
+
* Fast: performance critical code is still C. Minimal Lua is executed for
30
+
manipulating and deciding how to route requests.
39
31
40
32
## Configuration API {#configuration_api}
41
33
42
-
To load the configuration, a dedicated thread first compiles the Lua code. It then calls the function `mcp_config_pools`, which loads all backends, collects them into pools, and returns a Lua table holding all of the final pool objects. Next, for each worker thread, they each execute `mcp_config_routes`. This function is expected to set up route handling (code that matches requests to a pool), and sets the command hooks that memcached will call (ie; hooks on get, set, and so on).
34
+
To load the configuration, a dedicated thread first compiles the Lua code. It then calls the function `mcp_config_pools`, which loads all backends, collects them into pools, and returns a Lua table holding all of the final pool objects. Next, each worker thread calls `mcp_config_routes`. This function is expected to set up route handers and sets the command hooks that memcached will call (ie; hooks on get, set, and so on).
43
35
44
-
<preclass="mermaid">
36
+
```mermaid
45
37
---
46
38
title: Loading Configuration
47
39
---
@@ -57,7 +49,7 @@ flowchart TD
57
49
C2["Run mcp.attach(CMD, handler)"]
58
50
end
59
51
configure --> |for each worker: copy lua code and config table|worker
60
-
</pre>
52
+
```
61
53
62
54
The proxy flow starts by parsing a request (ie: `get foo`) and looking for a function hook for this command. If a hook exists, it will call the supplied function. If no hook exists, it will handle the request as though it were a normal memcached.
63
55
@@ -262,7 +254,7 @@ _all_ enqueued requests are immediately executed.
262
254
This means if you enqueue two requests, then queue and wait on a third, all
263
255
three requests are batched and executed simultaneously.
0 commit comments