pub unsafe extern "C" fn aeron_exclusive_publication_try_claim(
publication: *mut aeron_exclusive_publication_t,
length: usize,
buffer_claim: *mut aeron_buffer_claim_t,
) -> i64
Expand description
Try to claim a range in the publication log into which a message can be written with zero copy semantics. Once the message has been written then aeron_buffer_claim_commit should be called thus making it available. A claim length cannot be greater than max payload length.
Note: This method can only be used for message lengths less than MTU length minus header.
@code aeron_buffer_claim_t buffer_claim;
if (aeron_exclusive_publication_try_claim(publication, length, &buffer_claim) > 0L) { // work with buffer_claim->data directly. aeron_buffer_claim_commit(&buffer_claim); } @endcode
@param publication to publish to. @param length of the message. @param buffer_claim to be populated if the claim succeeds. @return the new stream position otherwise a negative error value.