Declaraciones públicas de media-daemon/ipc/ingest_ipc.zig (media-daemon: IPC de ingesta).
apps/docs/generated/zig/media-daemon-ipc-ingest.jsonPágina generada desde
native/zig/media-daemon/ipc/ingest_ipc.zig. No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
Ingest handlers of the control socket (dec-0121, dec-0120;
protocols/session-ipc messages/ingest.md). Bun decides who may upload
(playback-svc, after resolving the user's access token), the daemon
executes: it binds an ingest session in the capability authority and
reports finished uploads. Bytes never travel here: the client uploads to
the IngestSink's endpoint.
cmd.media.openIngest{capActor, capResource} -> {result: {sessionId, endpoint, rootId}} | {error} cmd.media.pollIngestEvents{ackSeq} -> {events: [...]} | {error} cmd.media.closeIngest{sessionId} -> {closed}
Requests arrive already verified by spire (signature, allowlist from
BUS_ROUTES, contract: digest shapes, handle alphabet, bounds); what is
left here is what the schema cannot say.
openIngest binds ing_<32 hex> to the actor and to this daemon's ingest
root (the resource must be ingestRoot(rootId), anything else is
refused): an SCT of scope ingest for that session is what the sink
accepts. closeIngest unbinds it: every token of the session dies at
once (revocation), and the sink aborts its unfinished uploads (slot,
staging reservation and .part back). pollIngestEvents acknowledges every event up to
ackSeq (playback-svc had catalog register them) and returns the oldest
unacknowledged ones, at most max_events_per_reply.
Contexttype · línea 36
pub const Context = structWhat the ingest handlers need from the daemon (nothing owned).
max_events_per_replyconst · línea 45
pub const max_events_per_reply = 32MAX_INGEST_EVENTS_PER_POLL of the contract (maxItems of events).
openIngestfn · línea 52
pub fn openIngest(ctx: Context, arena: std.mem.Allocator, req: contracts.MediaOpenIngestRequest) std.mem.Allocator.Error!OpenReplycmd.media.openIngest. Strings of the reply live in arena.
unbindIngestfn · línea 88
pub fn unbindIngest(ctx: Context, session_id: []const u8) boolUndo of an openIngest whose reply could not be sealed (spire
onReplyFailure): nobody would get the id to close it. Also the body of
closeIngest.
Unbinding kills every token of the session; IngestSink.revoke then
aborts its uploads, so a closed (or swept, abandoned) session stops
holding its actor's upload slot and staging reservation at once instead
of until conduit's idle expiry. Unbind first: after it no token of the
session is admitted again. The sink is revoked even when the binding was
already gone (a retried close cleans up whatever is left).
pollIngestEventsfn · línea 97
pub fn pollIngestEvents(ctx: Context, arena: std.mem.Allocator, req: contracts.MediaPollIngestEventsRequest) std.mem.Allocator.Error!PollReplycmd.media.pollIngestEvents. The events live in arena.
closeIngestfn · línea 122
pub fn closeIngest(ctx: Context, req: contracts.MediaCloseIngestRequest) contracts.MediaCloseIngestReplycmd.media.closeIngest: unbinding revokes every token of the session.
Idempotent: closed: false when it was not bound (any more).