igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Interface MobileProcessBackgroundShape

    The app process's background work that belongs to no screen and no caller: the one background fiber set the process owns, created in the process's scope by makeMobileProcessBackgroundLayer on every platform.

    It carries the launch's tail — the part of the launch the app keeps sending after the feed is on screen (owner decision, 2026-10-27). A launch hands its tail over through MobileProcessBackgroundShape.handOver, so the requests still go out in full although the launch has already returned the screen and the caller's main may be one short request. A fiber handed over lives as long as the process — neither the launch's scope nor main's owns it — and the process's end interrupts it, because the set's scope is the process's. The capability is narrow in shape — hand work over, wait for the set, kill it — and never the raw FiberSet. It is a service of the userland surface because the launch runs on that surface and requires it, so a program that composes the layer itself can hand work over, wait or kill as well.

    One owner of "a background failure ends the process". A fiber handed over that fails with a session-fatal failure (a checkpoint, a lost login, a suspended or disabled account), or whose challenge the call's otherwise could not settle (OtherwiseDispatchStop, the call's typed refusal), ends the process (AppProcessReference.end) instead of leaving a failure in the set: the run that owns the process stops main with that same typed error, or — when main already returned — rejects the call with it, and every later request and the set's wait fail with it (AppProcessReference.stillRunning). The work's typed failures are session-fatal ones by type; a defect stays a defect, the set's outcome (MobileProcessBackgroundShape.settled).

    The app's own process timers are not in it: they are the platform's loops, interrupted at the same disposal (Android's are the routing-map refresh and the Direct presence re-read, in the platform package), and they end the process by the same reference.

    interface MobileProcessBackgroundShape {
        handOver: <A, E extends SessionFatalError, R>(
            work: Effect<A, E, R>,
        ) => Effect<void, never, R>;
        kill: Effect<void>;
        settled: Effect<void, SessionFatalError>;
    }
    Index

    Properties

    Properties

    handOver: <A, E extends SessionFatalError, R>(
        work: Effect<A, E, R>,
    ) => Effect<void, never, R>

    Hands work to the process's background fibers, started now. The hand-over itself cannot fail. The work starts outside the process's screen turn (ScreenTurnHeld false), even when the launch hands it over from inside its own: a challenge over a tail request is answered with the turn to itself, so it queues behind the caller's actions instead of running beside them. The work's typed failures are session-fatal ones by type (the launch's tail is backgroundRequests, which keep every other failure as an outcome): one ends the process, and so does the stop of a challenge the call's branches could not settle; in a process that cannot end (no process reference) the failure is the set's outcome (MobileProcessBackgroundShape.settled), and a defect is the set's outcome too. A fiber that fails never cuts its siblings.

    kill: Effect<void>

    Interrupts whatever is still running: killing the app stops its background work at once, so a disposal never waits on the network. The entries run it for an aborted call, before the connections close.

    settled: Effect<void, SessionFatalError>

    Waits until every handed-over fiber finished — never before the set emptied, so a failing fiber does not stop its siblings: the rest of the tail still goes out — and then fails with what the background left: the process's end when it ended (AppProcessReference.stillRunning: the session-fatal error itself, typed, the same object; any other end as a defect), else the first failure the set kept — where no process reference is readable (the layer's own finalizer, a process that cannot end): the session-fatal error itself, the stop's typed failure as a defect, a defect as itself. A fiber of the set, and a computation inside the process's screen turn, do not wait: the first would wait for its own end, the second for a challenge answer that needs the turn it holds.