KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Data Fields
KlEventCtx Struct Reference

Composable event loop context. More...

#include <event_ctx.h>

Collaboration diagram for KlEventCtx:
Collaboration graph
[legend]

Data Fields

KlEventLoop loop
 
KlAllocatoralloc
 
KlWatcherwatchers
 
int dispatch_dirty
 
KlError last_error
 
KlTimerEntrytimers
 
int timer_count
 
int timer_cap
 
int64_t timer_next_id
 

Detailed Description

Composable event loop context.

Contains the platform event loop, allocator, and watcher list. Embedded in KlServer via composition. Can also be used standalone (e.g. by KlClient, KlThreadPool) without requiring a full server.

Field Documentation

◆ loop

KlEventLoop KlEventCtx::loop

Platform event loop

◆ alloc

KlAllocator* KlEventCtx::alloc

borrowed — must outlive ctx

◆ watchers

KlWatcher* KlEventCtx::watchers

Head of ctx-owned watcher list

◆ dispatch_dirty

int KlEventCtx::dispatch_dirty

set by kl_watcher_mod/del during callback

◆ last_error

KlError KlEventCtx::last_error

diagnostic: set at point of return -1

◆ timers

KlTimerEntry* KlEventCtx::timers

min-heap array (NULL until first add)

◆ timer_count

int KlEventCtx::timer_count

entries in heap

◆ timer_cap

int KlEventCtx::timer_cap

allocated slots

◆ timer_next_id

int64_t KlEventCtx::timer_next_id

monotonic ID counter


The documentation for this struct was generated from the following file: