summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-08-24 21:05:06 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-08-25 21:16:29 +0100
commit6f70b1fe44582f195654bb41c41d43f2eb78a975 (patch)
treecc36cf2d21ee7569d4575509a5d7cd6be13ba9cf
parentf9c01f4f721969c7dbe6152bbd38cc039acb27bf (diff)
downloadunit-wasm-6f70b1fe44582f195654bb41c41d43f2eb78a975.tar.gz
unit-wasm-6f70b1fe44582f195654bb41c41d43f2eb78a975.tar.bz2
README.md: Update the README and config example
This takes into account the recent porting of the Rust demo applications to the new 'rusty' wrappers. The updates relate to the function handler names, the ones provided by the application now use the uwr_ prefix, the malloc and free handlers are still using the luw_ prefix as the applications aren't providing their own versions of those, the ones from libunit-wasm will be used. This is a useful demonstration of a number of things, but ultimately that you can call these handlers anything you want. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--README.md18
-rw-r--r--unit-wasm-conf.json12
2 files changed, 15 insertions, 15 deletions
diff --git a/README.md b/README.md
index fd5af73..805c54c 100644
--- a/README.md
+++ b/README.md
@@ -88,11 +88,11 @@ You can now use this in Unit with the following config
"my-wasm-example": {
"type": "wasm",
"module": "/path/to/my-wasm-example/target/wasm32-wasi/debug/my_wasm_example.wasm",
- "request_handler": "luw_request_handler",
+ "request_handler": "uwr_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
- "module_init_handler": "luw_module_init_handler",
- "module_end_handler": "luw_module_end_handler"
+ "module_init_handler": "uwr_module_init_handler",
+ "module_end_handler": "uwr_module_end_handler"
}
}
}
@@ -304,20 +304,20 @@ Create the following Unit config
"rust-echo-request": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/rust/echo-request/target/wasm32-wasi/debug/rust_echo_request.wasm",
- "request_handler": "luw_request_handler",
+ "request_handler": "uwr_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
- "module_init_handler": "luw_module_init_handler",
- "module_end_handler": "luw_module_end_handler"
+ "module_init_handler": "uwr_module_init_handler",
+ "module_end_handler": "uwr_module_end_handler"
},
"rust-upload-reflector": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/rust/upload-reflector/rust_upload_reflector.wasm",
- "request_handler": "luw_request_handler",
+ "request_handler": "uwr_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
- "request_end_handler": "luw_request_end_handler",
- "response_end_handler": "luw_response_end_handler"
+ "request_end_handler": "uwr_request_end_handler",
+ "response_end_handler": "uwr_response_end_handler"
}
}
}
diff --git a/unit-wasm-conf.json b/unit-wasm-conf.json
index 3cb7267..0f5c3d3 100644
--- a/unit-wasm-conf.json
+++ b/unit-wasm-conf.json
@@ -68,20 +68,20 @@
"rust-echo-request": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/rust/echo-request/target/wasm32-wasi/debug/rust_echo_request.wasm",
- "request_handler": "luw_request_handler",
+ "request_handler": "uwr_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
- "module_init_handler": "luw_module_init_handler",
- "module_end_handler": "luw_module_end_handler"
+ "module_init_handler": "uwr_module_init_handler",
+ "module_end_handler": "uwr_module_end_handler"
},
"rust-upload-reflector": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/rust/upload-reflector/rust_upload_reflector.wasm",
- "request_handler": "luw_request_handler",
+ "request_handler": "uwr_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
- "request_end_handler": "luw_request_end_handler",
- "response_end_handler": "luw_response_end_handler"
+ "request_end_handler": "uwr_request_end_handler",
+ "response_end_handler": "uwr_response_end_handler"
}
}
}