pub unsafe extern "C" fn aeron_publication_try_claim(
    publication: *mut aeron_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. If the claim is held for more than the aeron.publication.unblock.timeout system property then the driver will assume the publication thread is dead and will unblock the claim thus allowing other threads to make progress and other claims to be sent to reach end-of-stream (EOS).

@code aeron_buffer_claim_t buffer_claim;

if (aeron_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.