Skip to content

Commit 6c93e45

Browse files
committed
basic fixes for api reference
mermaid charts weren't rendering.
1 parent 30a15e5 commit 6c93e45

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

content/features/proxy/api-reference.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,26 @@ At this stage API functions are mostly stable, but are still subject to
1414
occasional change. Most changes in functionality will be either additions or
1515
with a backwards-compatible deprecation cycle.
1616

17-
After 1.6.23, we do not expect major core changes to the API. We will stick to
18-
incremental improvements.
19-
2017
## Features
2118

2219
* Supports most of the text and meta protocols
2320
* Dynamically configured backend pools and route handling
2421
* Pluggable key distribution hashing algorithms
2522
* 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
2824
the proxy
2925
* Design routes to precisely fit your needs via simple Lua
26+
* Use TLS to connect to memcached backends
3027
* Flexible topologies: Run as a sidecar client, a large border proxy, or
3128
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.
3931

4032
## Configuration API {#configuration_api}
4133

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).
4335

44-
<pre class="mermaid">
36+
```mermaid
4537
---
4638
title: Loading Configuration
4739
---
@@ -57,7 +49,7 @@ flowchart TD
5749
C2["Run mcp.attach(CMD, handler)"]
5850
end
5951
configure --> |for each worker: copy lua code and config table|worker
60-
</pre>
52+
```
6153

6254
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.
6355

@@ -262,7 +254,7 @@ _all_ enqueued requests are immediately executed.
262254
This means if you enqueue two requests, then queue and wait on a third, all
263255
three requests are batched and executed simultaneously.
264256

265-
<pre class="mermaid">
257+
```mermaid
266258
---
267259
title: enqueue all at once
268260
---
@@ -272,9 +264,9 @@ flowchart TD
272264
C -->|request| D[backend]
273265
C -->|request| E[backend]
274266
C -->|request| F[backend]
275-
</pre>
267+
```
276268

277-
<pre class="mermaid">
269+
```mermaid
278270
---
279271
title: enqueue in stages
280272
---
@@ -284,7 +276,7 @@ flowchart TD
284276
C -->|request| D[backend]
285277
C -->|request| E[backend]
286278
```
287-
</pre>
279+
```
288280
289281
### Where is the results table?
290282

0 commit comments

Comments
 (0)