Files
qing 81ba942b8e feat(libmsg): extract pymsg-compatible messaging library as shared lib
- Add libmsg: C++20 header-only pymsg protocol implementation
  - Msg.hpp: pmsg_send/pmsg_recv (blocking + deadline modes) + MsgClient
  - MsgServer.hpp: multi-client TCP server with select event loop + thread pool
  - AsyncQueue<T>: generic async batch processing queue
  - RpcClient/RpcServer: JSON RPC convention layer (requires boost::json)
  - Msg_Basic.hpp/cpp: exception hierarchy, constants, version
- Fix thread safety: MsgClient _sockfd/_running use std::atomic with exchange()
- Fix deadline recv: client call() uses shared deadline for header+payload
- Fix graceful shutdown: thread pool drains queued tasks before exit
- Fix pmsg_send size check: enforce 64MiB limit (was 4GiB no-op check)
- Align AsyncQueue batch semantics with Python: batch_size is threshold
- Refactor gateway/LogC.hpp to use libmsg AsyncQueue<T>
- Update gateway Makefile to link -lus_msg, DbC.hpp to use <us/Msg.hpp>
- Add libmsg to _inst.sh build order
2026-08-06 23:14:13 +08:00

42 lines
766 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
run_if_exists() {
local script="$1"
echo "---- run ${script} ----"
if [ -f "$script" ]; then
bash "$script"
fi
}
inst_module() {
local module="$1"
echo "======== Install ${module} ========"
local set_file="./${module}/_set.sh"
if [ -f "$set_file" ]; then
run_if_exists "$set_file"
return 0
else
echo "Failed" >&2
return 1
fi
}
inst_module "libth"
inst_module "libhttp"
inst_module "libcrypt"
inst_module "libmsg"
inst_module "libsqlite3"
inst_module "gateway"
inst_module "waf" # waf 在 gateway 之前编译,部署时由 core 先拉起 waf 再拉起 gateway
inst_module "static"
inst_module "dnfs"
inst_module "db"
inst_module "smtp"
inst_module "captcha"
inst_module "confs"
inst_module "core" # core last