Skip to content

v4 docs: Execution Context page - #528

Draft
simonhamp wants to merge 1 commit into
mainfrom
docs-execution-context
Draft

simonhamp wants to merge 1 commit into
mainfrom
docs-execution-context

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Adds a docs page for the ExecutionContext facade under Digging Deeper.

The thing it's really there to explain is that iOS will cold-launch the whole app into the background to run scheduled work, with nobody looking at the screen. NativePHP splits its boot for this: the runtime always comes up so your command can run, but the interactive boot (start URL, first screen, web view, queue worker) is held back until the app is genuinely on screen. That catches people out, so the page says it plainly and gives them isHeadless() to check.

Covers the five common checks, the device-lock check and why it matters most in background work, a worked background command, all eleven facade methods, the Android differences, and how to fake the context in tests.

Also adds a short section to the queue worker page saying why the worker doesn't start during a background wake and what happens to jobs you dispatch there.

Method list was checked against src/Facades/ExecutionContext.php in the mobile repo and matches.

Worth a look:

  • The Background Tasks plugin link points at ../plugins/core/background-tasks, same convention as the other core plugin links. Those resolve to the plugin marketplace, so it depends on that plugin being listed there.
  • Ordered at 15, between Lifecycle Hooks (10) and Data Binding (20).

🤖 Generated with Claude Code

Documents the ExecutionContext facade and what a background cold launch
means for your code: the runtime boots but the interactive boot is held
back, so no start route, no screen, no queue worker. Covers the lock
state check, a background command example, all eleven facade methods,
Android differences and how to fake the context in tests.

Also adds a short section to the queue worker page explaining why the
worker doesn't start during a background wake.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b1d61773-c2b0-4754-a00f-a18cf8d8059c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant