pushinbr / pam-native-realtime
Persistent native WebSocket connections with bounded event queues for PAM Native.
Package info
github.com/push-in/pam-native-realtime
Language:Swift
Type:pam-native-plugin
pkg:composer/pushinbr/pam-native-realtime
Requires
- php: ^8.4
- pushinbr/pam-native: ^0.6.1
Requires (Dev)
- pushinbr/pam-native-testing: ^0.1.0
README
Persistent RFC 6455 connections owned by the native runtime. PHP can render, suspend or reload without implementing socket framing or holding a network loop.
composer require pushinbr/pam-native-realtime pam mobile codegen pam mobile ios:prepare
$realtime = new Pam\Native\Realtime\Realtime(); $realtime->connect('wss://api.example.com/socket', ['Authorization' => 'Bearer '.$token], ['pam.v1'], function (?string $id, ?string $error): void {}); $realtime->poll($id, function (?Pam\Native\Realtime\RealtimeEvent $event, ?string $error): void {});
Only wss:// endpoints are accepted. Text and binary frames are bounded per connection. Incoming events use a 256-item native queue and one pending long poll, with deterministic timeout and lifecycle cleanup. Android uses OkHttp 5.3.0; iOS uses URLSessionWebSocketTask.
Platform support: Android API 26+, iOS 15+, PAM Native 0.6.x.