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:
parent
f2342d10eb
commit
fdf731f5b6
1 changed files with 12 additions and 0 deletions
12
src/zap.zig
12
src/zap.zig
|
@ -22,10 +22,22 @@ const _module = @This();
|
|||
// TODO: replace with comptime debug logger like in log.zig
|
||||
var _debug: bool = false;
|
||||
|
||||
/// Start the IO reactor
|
||||
///
|
||||
/// Will start listeners etc.
|
||||
pub fn start(args: fio.fio_start_args) void {
|
||||
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 {
|
||||
if (_debug) {
|
||||
std.debug.print("[zap] - " ++ fmt, args);
|
||||
|
|
Loading…
Add table
Reference in a new issue