Runtime
The Semitexa runtime on long-running PHP workers: request context for tenant, auth and locale, sessions and cookies, and the state lifecycle.
-
Runtime State Lifecycle
Per-request, per-worker, persistent and test-only state: the Swoole-aware rules for which caches reset between requests and which survive.
-
Sessions and Cookies
The session contract and its Swoole Table storage, typed session segments, flash messages, and reading and writing cookies.
-
Request Context: Tenant, Auth, Locale
Reaching the per-request tenant, auth and locale, through the request-scoped container or statically, and when each is still at its default.
-
Worker Memory and Recycling
How a long-lived Swoole worker is restarted: SWOOLE_MAX_REQUEST, the memory limit, the memory watchdog, and what happens to the requests a leaving worker is still answering.
-
Long-Run Test of the Swoole Server
What a 50.8-hour run of release 2026.10.20.0340 under steady production-like load showed about latency over time, errors, worker recycling and memory.
-
Benchmark Baseline
Requests per second and latency of release 2026.11.05.1529 on four routes, with the machine, the method, the spread between runs, and how to measure your own.
-
Outbound HTTP
Call other services through HttpClientInterface — timeouts, opt-in retries with Retry-After, coroutine-friendly under Swoole — and assert what was sent with FakeHttpClient.
-
Logging
Write structured log lines through LoggerInterface, choose a file, stderr or both with LOG_SINK and per channel with LOG_CHANNELS, and read them back with logs:app — rotation and levels included.
-
Webhooks
Receive signed webhooks on a service route with #[AsWebhookReceiver] and a shared replay store, and send your own through a durable outbox that webhook:work signs, delivers and retries.
-
Workflows and State Machines
Declare a business process as a code-defined state machine with #[AsWorkflowDefinition], move instances through guarded transitions with WorkflowEngineInterface, and let the scheduler fire timeouts and retry failed side effects.
-
Scheduled and Delayed Jobs
Run work on a clock with #[AsScheduledJob], queue one-off jobs through SchedulerInterface, and let scheduler:plan and leased scheduler:work processes run them with retries, overlap locks and per-tenant runs.
-
Localization
Translation catalogs, trans() and plurals, how each request's locale is resolved (URL prefix, cookie, Accept-Language, tenant pack), locale-aware URLs and redirects, and how the locale travels through coroutines, async work and queued jobs.
-
Sending Mail
Send mail through MailServiceInterface with inline bodies or Twig templates rendered in the mail's own locale, queue it for the mail:work worker or send it at once, and see how SMTP, idempotency keys, retries, the mail_messages and mail_attempts tables and FakeMailTransport behave.
-
Notifications
Tell recipients about something once and let semitexa/notifications deliver it over mail, a database inbox or your own channels, in each recipient's locale and honouring their opt-outs, with safe retries, an unread inbox, a retention command and FakeNotifier for tests.
-
Deploying and Updating a Server
Put a project on a fresh Ubuntu server with update:packages:bootstrap-remote, keep its semitexa/* packages current with update:packages:auto and a systemd timer, and know what a failed deploy rolls back and what no deploy does.