Shared knowledge · Advanced · Bounded data plane

Choose messages, File Lane or Stream Lane

Messages carry small commands, events and metadata. File Lane moves one immutable object with a known size and SHA-256. Stream Lane moves a sequence of incrementally produced frames. Both keep bulk bytes outside Envelope.payload.

01 · Choose by data shape

Large data does not automatically mean streaming

CoAkka Runtime message

A small command, query, event, reference or metadata. Target, correlation and Deadletter preserve control flow.

File Lane

An immutable object with a known final size that needs SHA-256, durable staging, resume and atomic publication.

Stream Lane

A live or incremental source with frame boundaries, no useful final size and byte-credit backpressure.

Recorded video or model binary
Use File Lane when the receiver needs the complete object, integrity and resume.
Live camera, microphone or telemetry
Use Stream Lane when the consumer processes frames and current data matters more than replaying every old item.
Durable replay or many subscribers
Use an object store, event/media system or app-host fan-out above the lane. Stream Lane v1 is point-to-point, not a broker or player protocol.
control plane: authorize + exchange identity/grant
CoAkka Runtime message: command, event, metadata, result
File Lane:     bounded point-to-point immutable bytes
Stream Lane:   bounded ordered point-to-point frames

02 · File Lane

The receiver prepares first; integrity decides completion

The application authorizes the operation and computes exact size and SHA-256. The receiver prepares a destination with a transfer ID and transfer-scoped token. The sender submits only after it receives the exact owner endpoint. The receiver writes staging data, publishes durable checkpoints, verifies the full digest and atomically replaces the destination.

Lane configuration

Directions
Enable sender, receiver or both. Open only the direction the process actually owns.
Bind host/port
The receiver listener; port 0 lets Core select the actual port.
Queue capacity
Default 8, hard ceiling 64 across queued work, prepared receives and retained records.
Maximum file size
Default 4 GiB. Exceeding the bound returns SIZE_LIMIT instead of buffering silently.
I/O timeout
Default 30 seconds for an idle network/TLS operation.
Checkpoint bytes
Default 4 MiB. committed_offset is receiver-durable resume truth.
Progress thresholds
Default every 1 MiB or 250 ms, whichever comes first; independent of checkpoints.
Workers
Default 1 sender and 1 receiver, maximum 4 for each direction.
Security
DIRECT, TLS or MUTUAL_TLS, fixed for the lane lifetime.

Per-transfer fields

Transfer ID
Unique identity of the prepared transfer and retained record.
Authorization token
Bearer capability for this transfer only; never log or reuse it for another transfer.
Destination path
A receiver-owned, pre-authorized path; a remote peer never supplies an unrestricted filesystem path.
Source path
Sender-owned immutable source. A retained open handle prevents path replacement from changing identity.
Expected size + SHA-256
Both peers must agree. Source change or integrity mismatch becomes an explicit terminal result.
Remote endpoint
The exact receiver-owner host/port, never a replica-load-balancing Service address.

Sender success is not authority to use the file. The receiver must reach COMPLETED + OK; a local 100% byte count does not replace verified receiver completion.

03 · Stream Lane

The publisher produces frames only while the subscriber has byte credit

The publisher prepares a session with a source callback, session ID, token, format_id and maximum frame size. The subscriber uses the same grant, declares a bounded receiver window and supplies a consumer callback. Frames stay ordered; credit returns only after the consumer finishes.

Lane configuration

Directions
Enable publisher, subscriber or both according to process ownership.
Bind host/port
The publisher listener; an owner-aware grant returns the direct advertised endpoint and actual port.
Capacity
Default 8, hard ceiling 64 across prepared publishers, queued subscribers and retained records.
Maximum frame
Default 256 KiB, hard ceiling 4 MiB. Every frame is non-empty and within the negotiated bound.
Receiver window
Default four maximum-sized frames, hard ceiling 16 MiB, and large enough for at least one maximum frame.
I/O timeout
Default 30 seconds for an idle transport operation.
Source retry
Default 5 ms after WOULD_BLOCK; a source callback cannot block indefinitely.
Progress
Default every 30 frames or 250 ms.
Workers
Default 1 publisher and 1 subscriber, maximum 4 for each direction.
Pressure timing
Default pressured at 100 ms, stalled at 1000 ms, recovery at 500 ms and observation at 100 ms; each interval has a 60-second ceiling.
Security
DIRECT, TLS or MUTUAL_TLS; the token still authorizes the session.

Session and frame fields

Session ID
Identity of the prepared publisher/session record.
Authorization token
A single-admission capability; the first valid OPEN consumes it.
format_id
A 64-bit application compatibility identifier. Core compares but does not parse the codec/schema.
Maximum frame bytes
The peers negotiate one bound; it is not a target bitrate or codec setting.
Initial window bytes
Bound on in-flight payload; the publisher stops when credit is exhausted.
Sequence
Core assigns values beginning at 1 and incrementing per frame so the consumer observes ordering.
Capture timestamp
Monotonic time from the source, or CoAkka Runtime monotonic time when the source leaves it zero.
Flags / dropped before
Keyframe, discontinuity, segment boundary and source-reported dropped frames/samples.

The consumer borrows frame bytes only during its callback. Copy any data that must outlive the callback. The source callback receives a writable CoAkka Runtime buffer and likewise must not retain pointers or destroy the lane from inside the callback.

04 · Replica ownership

A grant belongs to the process that prepared its state

Simple

Use it when one owner has a stable endpoint or application control state already pins ID, token, metadata and endpoint together.

Owner-aware

Use it when a prepare command may select one of several replicas. The grant carries exact owner instance and direct endpoint; connectors feature-detect the capability.

05 · Lifecycle and evidence

Each peer has its own terminal record

File transfer

PREPARED → QUEUED → CONNECTING → TRANSFERRING → VERIFYING → COMPLETED, or PAUSED / REJECTED / FAILED / CANCELED. Receiver COMPLETED + OK is authoritative.

Stream session

PREPARED → QUEUED → CONNECTING → ACTIVE → ENDED, or REJECTED / FAILED / CANCELED. ENDED + OK means only normal source completion, not durability or replay.

  1. Wait from the last update_sequence; do not busy-poll. Intermediate updates may coalesce, while terminal state remains retained.
  2. Record local terminal outcomes on both peers. One side's success does not infer successful publication/consumption on the other.
  3. cancel is cooperative. Completed and published work can win over a late cancel.
  4. Call forget only after the app stores the outcome. Forget removes a CoAkka Runtime record, not application-owned files.
  5. Close after active waits, callbacks and API calls return; close stops, wakes waiters and drains the owner.

File Lane reports queue, size, timeout, source-change, integrity, storage, network and certificate failures as stable results. Stream Lane reports INACTIVE / FLOWING / PRESSURED / STALLED / RECOVERING with reason bits for credit, transport or consumer pressure. These are transport observations; the app chooses bitrate, capture mode, retry, sink and user-facing outcomes.

06 · Review before integration

Checklist by boundary

Application/control plane

  • Authorize before prepare.
  • Generate strong IDs/tokens and never log grants.
  • Keep business metadata outside the bulk-byte lane.
  • Choose destination/source/sink and post-success action.
  • Own retry, resume, fan-out and quality policy.

CoAkka Runtime/Core

  • Bound admission, workers, buffers and retained state.
  • Validate identity, token, size/format and endpoint.
  • Own transfer/session lifecycle, progress, pressure and terminal results.
  • Verify file integrity and atomic publication.
  • Do not interpret business payload, codec or user authorization.

Deployment/security

  • Use an exact owner address, not a replica Service.
  • Allow direct connection in NetworkPolicy.
  • Use DIRECT only inside a protected boundary.
  • Match TLS SAN to the grant host; mTLS does not replace app authorization.
  • Rotate credentials through a replacement lane under the current contract.

Host integration

  • Move blocking waits off a UI/event loop.
  • Copy borrowed Stream bytes before callback return.
  • Bound source/device waits so stop/cancel remains observable.
  • Wait for both peers, record outcomes, then forget.
  • Never expose paths, tokens or unrestricted lane APIs to a browser renderer.