summaryrefslogtreecommitdiffstats
path: root/worker.c
diff options
context:
space:
mode:
authormrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-21 02:36:23 +0300
committermrfoxygmfr <mrfoxygmfr@sch9.ru>2025-05-21 02:36:23 +0300
commit7d4e357bac40a3ef792bb9fc25c9340c5b0131d6 (patch)
tree4d842c5e72a62eb71a9dbc892cce2da6760eda73 /worker.c
parent1ecdfe36f781532a862489725a8630a71079e989 (diff)
feat: add controller and worker examples
Diffstat (limited to 'worker.c')
-rw-r--r--worker.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/worker.c b/worker.c
new file mode 100644
index 0000000..c6698d9
--- /dev/null
+++ b/worker.c
@@ -0,0 +1,16 @@
+#include "./lib/worker.h"
+
+void func(const char* task, size_t task_size, char** resp, size_t* resp_size) {
+ printf("HERE %*s\n", (int) task_size, task);
+
+ task = task;
+ task_size = task_size;
+ *resp = malloc(10);
+ *resp_size = 10;
+ sleep(1);
+}
+
+int32_t main() {
+ worker_init("127.0.0.1", "33554", 2, func);
+ worker_exec();
+}