opcua-session-managerlisted
Install: claude install-skill php-opcua/ai-skills
# php-opcua/opcua-session-manager — v4.4.0 skill
A ReactPHP daemon that holds OPC UA sessions in memory across short-lived PHP requests. `ManagedClient` is a drop-in `OpcUaClientInterface` replacement that talks to the daemon via local IPC — the application code is **identical** to direct `Client` usage, but the OPC UA handshake (50–200 ms) is paid once at daemon startup, not per request.
## When to use this skill
Activate when the user is solving one of these problems:
- **OPC UA from web requests** (Laravel/Symfony/FPM): every request triggers Connect → CreateSession → ActivateSession (~150 ms). The daemon caches the session.
- **Keeping subscriptions alive** across requests so notifications aren't lost between page loads.
- **Auto-publish loop** running outside the request lifecycle, dispatching PSR-14 events to the framework's listener bus.
- **Long-lived OPC UA gateway** consuming from PLCs and forwarding to HTTP / Kafka / MQTT.
- **Cross-platform IPC** — they want it to work on Windows too (auto-falls-back to TCP loopback).
Do NOT activate for: direct connections from CLI scripts that run once (`bin/opcua-cli read ...`) — those don't benefit from the daemon. Use `opcua-client` directly.
## The 60-second mental model
```
PHP request (short-lived) SessionManagerDaemon (long-lived)
───────────────────────── ─────────────────────────────────
new ManagedClient($endpoint) SessionManagerDaemon::run()