prefect server in zig
messaging#
inter-component communication via messaging.zig.
bounded channel#
generic thread-safe queue with backpressure:
pub fn BoundedChannel(comptime T: type, comptime capacity: usize) type
operations:
trySend()- non-blocking, returns false if fullreceiveTimeout()- blocking with timeoutdrain()- batch receive up to N itemsclose()- signal shutdown, wake waiters
event channel#
global channel for event ingestion:
pub const EventChannel = BoundedChannel(StoredEvent, 50000);
50k capacity matches python prefect's backpressure limit. dropped events logged with periodic sampling.
usage#
producers call publishEvent(), consumers get channel via getEventChannel().
future#
current implementation is in-memory. interface designed to support:
- redis streams
- kafka
swap implementation without changing producer/consumer code.