1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 23:24:09 +00:00

expose zap.stop()

This commit is contained in:
Rene Schallner 2023-05-24 01:23:43 +02:00
parent f2342d10eb
commit fdf731f5b6

View file

@ -22,10 +22,22 @@ const _module = @This();
// TODO: replace with comptime debug logger like in log.zig // TODO: replace with comptime debug logger like in log.zig
var _debug: bool = false; var _debug: bool = false;
/// Start the IO reactor
///
/// Will start listeners etc.
pub fn start(args: fio.fio_start_args) void { pub fn start(args: fio.fio_start_args) void {
fio.fio_start(args); fio.fio_start(args);
} }
/// Stop ZAP:
///
/// 1. Stop accepting further incoming requests
/// 2. Wait for all running request handlers to return
/// 3. return from `zap.start(...)`
pub fn stop() void {
fio.fio_stop();
}
pub fn debug(comptime fmt: []const u8, args: anytype) void { pub fn debug(comptime fmt: []const u8, args: anytype) void {
if (_debug) { if (_debug) {
std.debug.print("[zap] - " ++ fmt, args); std.debug.print("[zap] - " ++ fmt, args);