Skip to main content

q_encode

Function q_encode 

Source
pub unsafe extern "C" fn q_encode(
    msg: *mut ray_t,
    req: *mut *mut u8,
    req_len: *mut i64,
    err: *mut c_char,
    errlen: usize,
) -> c_int
Expand description

Serialize msg into a complete Q wire request (8-byte header + body). The buffer is malloc’d by C and must be released with libc::free. q_encode always stamps the header’s message-type byte as SYNC; a publisher retypes req[1] in place to send ASYNC or RESPONSE. Touches the symbol table: engine thread only.