Skip to main content

record_blocking

Function record_blocking 

Source
pub fn record_blocking(event: Event)
Expand description

Write an event synchronously, without the writer thread.

The synchronous escape hatch for the three paths where the async world is gone or going: the panic hook, record_caught_panic, and the signal task immediately before std::process::exit. One O_APPEND write(2) under PIPE_BUF, a sync_data, and return — microseconds.

The append takes the shared privacy lock with try_write(), never a blocking acquisition. If the actor, a wipe, or another Codewhale process sharing CODEWHALE_HOME holds it, the event is dropped immediately. This preserves the panic/SIGINT liveness contract without allowing a write to race past a completed opt-out.

A no-op when unarmed, which is what makes a disabled user’s panic write nothing and create no directory.