- What is thruway/pawl-transport used for?
- It provides a Pawl-based WebSocket transport for the Thruway PHP WAMP client. It lets Thruway open asynchronous WebSocket connections using a ReactPHP-driven event loop. Developers use it to build pub/sub and RPC messaging features in PHP applications.
- How do I install thruway/pawl-transport with Composer?
- Install it with Composer by requiring thruway/pawl-transport in your project. Composer will also resolve its Thruway and Pawl dependencies. In a Laravel app, run the Composer command from your project root and then autoload dependencies as usual.
- Does thruway/pawl-transport support Laravel 10 or Laravel 11?
- The package is a PHP transport adapter rather than a Laravel-specific package, so Laravel compatibility depends on its PHP and dependency constraints. Check the package's Composer requirements against the PHP version used by your Laravel release. It can be used inside Laravel as long as Thruway, Pawl, and ReactPHP dependencies are compatible.
- How do I configure a Pawl WebSocket connection with Thruway?
- You create a Pawl connector, pass it to the Thruway client, and connect to a WAMP router over WebSocket. The transport handles the WebSocket layer while Thruway manages WAMP sessions, subscriptions, and RPC calls. Configuration mainly involves the router URL and the ReactPHP event loop used by Pawl.
- What is the difference between Thruway and thruway/pawl-transport?
- Thruway is the WAMP client library, while thruway/pawl-transport is a transport implementation for it. Thruway defines client behavior such as sessions, pub/sub, and RPC, and the Pawl transport provides the actual WebSocket connection mechanism. You typically use both together rather than choosing one over the other.
- Can I use thruway/pawl-transport for pub/sub and RPC messaging?
- Yes, the transport supports Thruway's WAMP client features, including publish/subscribe and remote procedure calls. It supplies the WebSocket connection that carries those WAMP messages to a router. Your application logic for topics and RPC procedures is handled through Thruway's client API.
- Does thruway/pawl-transport require a ReactPHP event loop?
- Yes, Pawl is built around ReactPHP, so the transport uses a ReactPHP event loop for asynchronous WebSocket communication. You need to run the loop for connections, subscriptions, and RPC responses to be processed. This makes the package suited to long-running PHP processes rather than short-lived HTTP requests.
- How do I test WebSocket WAMP connections using thruway/pawl-transport?
- Testing usually involves running the ReactPHP event loop against a local or test WAMP router. You can assert that subscriptions receive published messages and that RPC calls return expected results through Thruway's client API. The package itself is a transport adapter, so it does not provide Laravel-specific testing helpers.
- What are production concerns when using thruway/pawl-transport in Laravel?
- Because it relies on a long-running ReactPHP event loop, it is best used in worker processes rather than normal Laravel HTTP requests. You should plan for process supervision, reconnects, error handling, and avoiding blocking code inside the loop. Also monitor WebSocket connections and WAMP router availability in production.
- Are there alternatives to thruway/pawl-transport for WAMP in Laravel?
- Alternatives include other Thruway transports, Ratchet-based WebSocket setups, or different WAMP client libraries with their own transport layers. The right choice depends on whether you need Pawl's ReactPHP integration, specific WAMP features, or Laravel-friendly real-time tooling. Evaluate maintenance status and compatibility with your PHP and Laravel versions.