Skip to main content

Crate xchannel

Crate xchannel 

Source
Expand description

xchannel: mmap-backed IPC channels with rolling files.

§Overview

  • Regionized file layout; region 0 starts with a MessageHeader(Channel) followed by ChannelHeader.
  • Pre-header pipeline for user records: For record i: header(i) is pre-installed (committed=0), writer copies payload(i) after it, then fills header(i) and sets committed=1 (Release), and finally pre-installs header(i+1).
  • Special markers: Skip (pad to next region), Roll (file rolled).

§Safety

Writers produce &mut references into an mmap; do not run a reader in the same process concurrently with a writer to the same file/region. For cross-process IPC this is fine. Publishing uses Release and reading uses Acquire.

Structs§

MessageBatch
Borrowed view over a batch of user messages.
MessageRef
Borrowed view of a message payload and header.
Reader
ReaderBuilder
RegionMapping
Encapsulates a single mmap-ed region. Mode is Mmap (read-only) or MmapMut (writable).
Writer
WriterBuilder

Enums§

ReaderMode

Functions§

cleanup_channel_files
Remove channel base and all rolled files created by this crate. Scans the parent directory for entries matching base and base.<N> and removes them, so this works correctly even when retention has left a sparse set of rolled files (e.g. with WriterBuilder::keep_files).
page_size
Return the OS page size.

Type Aliases§

ReadOnly
Writable