NAME

Linux::Event::Framer - native framing for ordered-byte I/O

SYNOPSIS

package LineSocket;
use parent 'Linux::Event::IO::Sock::Stream';
use Linux::Event::Framer 'Delimiter', "\n";

sub on_message ($stream, $message) {
    $stream->send($message);
}

DESCRIPTION

Linux::Event::Framer declares native framing policy for an ordered-byte Linux::Event subclass. Pipes, TTYs, and SOCK_STREAM connections share the same framing engine. The declaration is resolved once per concrete subclass; there is no per-connection framer object.

BUILT-IN FRAMERS

Supported declarations include Delimiter, Fixed, LengthPrefix, U32BE, Netstring, Varint, and DecimalLength. Each framer accepts its own framing options; see docs/FRAMING.md and the corresponding framer module POD.

Readable classes without a framer use on_data. Framed classes normally use on_message, or on_messages when explicit message batching is enabled.

NATIVE CONSUMERS

External XS extensions may consume complete framed messages without routing them through a Perl on_message callback:

Linux::Event::Framer->declare_native_consumer(
    'My::FramedConnection',
    {
        provider           => $provider_lifetime_token,
        abi_version        => $abi_version,
        operations_address => $native_table_address,
    },
);

This is an extension boundary for high-performance integrations such as coroutine or awaitable layers. It is independent of the public Perl class names and must not depend on retired implementation packages.

See docs/ORDERED-BYTE-CONSUMER-ABI.md.