Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zmq Laravel Package

react/zmq

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is not a Laravel package, and that distinction drives the entire evaluation. react/zmq is a ZeroMQ transport binding for the ReactPHP event loop — it is asynchronous, non-blocking, and assumes a long-lived process. Laravel's dominant execution model is request-scoped and synchronous (PHP-FPM), and its async story (Octane) is built on Swoole or RoadRunner, neither of which shares ReactPHP's loop. There is no supported path to using this inside a normal Laravel request lifecycle. The only viable shape is a standalone daemon — an artisan command that boots the ReactPHP loop, binds or connects ZeroMQ sockets, and bridges into the application through Redis, a queue, or an internal HTTP call. That is a meaningful architectural addition, not a dependency.

The genuine value proposition is narrow but real: brokerless, sub-millisecond, high-throughput inter-process messaging — PUSH/PULL work distribution or PUB/SUB fan-out — without standing up Redis, RabbitMQ, or Kafka. Against that, Laravel already ships queues (Redis, SQS, database) and broadcasting (Reverb/Pusher). The TPM question is whether any workload actually needs to beat those on latency badly enough to justify owning a raw socket topology.

Integration feasibility. Technically possible, operationally demanding. It requires the zmq PECL extension, which requires libzmq and a build toolchain on every host. That means a custom base image, not a stock php:8.x-fpm container. Once the extension is present, react/zmq itself is a thin, small surface — the risk is concentrated in the extension and the native library, not the PHP code.

Technical risk — high, and mostly non-technical:

  • Last release 2018-05-18. Seven years stale. It is a fork (friends-of-reactphp/zmq) of the abandoned react/zmq, meaning upstream maintenance already failed once.
  • 0 dependents. No ecosystem signal, no downstream consumers stress-testing it, nothing to learn from when it breaks. 247 stars is small for a foundational transport.
  • PHP 8.x compatibility is unverified in practice. The package targets ReactPHP v1 components, but the hard constraint is the php-zmq extension's ABI compatibility with modern PHP and libzmq 4.3.x. This must be proven on the actual target runtime before any design work proceeds.
  • No persistence, no acknowledgements, no dead-letter by default. Semantics are at-most-once. Reliability has to be engineered on top.

Key questions for the team:

  1. What is the concrete workload, and what latency/throughput number does it require that Redis or SQS cannot hit?
  2. Are we prepared to own a fork with no upstream and no dependents? Who patches it?
  3. Can we add native build dependencies to our deployment image and CI without breaking the platform roadmap?
  4. Where does the daemon run — same host, sidecar, or separate fleet — and how is it supervised and discovered?
  5. If ZeroMQ is rejected, what is the fallback, and is the abstraction layer thin enough to swap?

Integration Approach

Stack fit. Poor as a library dependency, acceptable as an isolated edge service. The recommendation is to treat it as infrastructure, not as a Composer package pulled into the monolith. The Laravel application should never use a ZMQ class directly. Instead: a dedicated worker process owns the sockets, and the application talks to it through an interface it already understands — a Redis list, a queue job, or an internal endpoint.

Migration path. There is no migration here, only a greenfield spike, because nothing existing can be "upgraded" into this. Sequence it as a bounded proof of value:

  1. Runtime validation (1–2 days). Build a Docker image with libzmq + php-zmq against the exact production PHP version. Confirm the extension loads under PHP 8.1/8.2/8.3 and that react/zmq boots. This is the go/no-go gate — most likely failure point, cheapest to test.
  2. Adapter boundary. Define an internal interface (e.g. MessageBus) with a Redis Streams implementation first, so the ZeroMQ version is a drop-in variant rather than a rewrite.
  3. Single-workload pilot. Pick one workload the team already understands — telemetry/log shipping, or a high-volume fan-out — and run it in parallel with the queue-based path. Compare on latency, throughput, and operational toil.
  4. Measure and decide. If the pilot does not show an order-of-magnitude win, retire it. Given the maintenance cost, "meets parity" is a failure condition.

Compatibility. Verified constraints: react/zmq v0.4 targets ReactPHP v1 components (react/event-loop, react/socket), so it will coexist with a current ReactPHP install. It will not coexist with Octane's Swoole/RoadRunner loop — those are separate processes with separate event loops, and mixing them is unsupported. Laravel version is largely irrelevant since the package never touches the framework; PHP version is the real variable.

Simpler alternative worth evaluating first. If the requirement is "talk to ZeroMQ from PHP," a plain blocking php-zmq call inside a standard artisan worker — no ReactPHP, no event loop — is dramatically simpler to reason about. react/zmq only earns its keep if you need many concurrent sockets in one process or a mix of messaging and async I/O on a single loop. Ask the team to justify that explicitly.

Operational Impact

Maintenance. This is the dominant cost and it should be budgeted as ownership, not as adoption. Assume the package is effectively frozen: no upstream fixes, no security patches, unclear PHP 9 readiness. Forking it into a private vendor namespace is the honest move if it ships, and that fork needs an owner with the ability to read C extension boundaries and ReactPHP internals. Low star count and zero dependents mean no community safety net and no StackOverflow corpus — every incident is first-principles debugging.

Support. No vendor, no SLA, no commercial backing. Internal escalation path only. Realistically this narrows the hiring pool: you need engineers comfortable with ZeroMQ socket semantics and ReactPHP promises and native extension packaging. Plan for one or two people to become the designated owners, with a documented runbook.

Scaling. ZeroMQ is brokerless, which moves the hard problems into your codebase. There is no central broker to scale, but also no central place to manage topology: endpoint lists, bind-vs-connect direction, and service discovery become application concerns. Growing consumers means coordinating endpoint changes across nodes rather than adding a worker. Throughput scales well; operability scales poorly relative to a managed broker. Expect to write tooling for endpoint configuration and health.

Failure modes to design against explicitly:

  • Silent message loss. Default at-most-once semantics; high-water-mark limits drop messages under backpressure with no error surfaced to the producer.
  • Slow-joiner in PUB/SUB. Late subscribers simply miss messages, with no replay. Any consumer that restarts loses the gap.
  • Event loop stalls. A single blocking call inside the loop halts every socket on that process — a class of bug that is hard to reproduce and easy to introduce.
  • Reconnect storms after a network blip or a supervisor restart cycle.
  • Memory growth in long-running processes — a known hazard for daemons that accumulate pending promises.
  • Extension/runtime drift. A base image bump that changes libzmq or PHP minor version can break the binary with no package release to point at.

All of these are recoverable, but each needs a supervisor policy, a monitoring signal, and a documented recovery step before production traffic touches the socket.

Ramp-up. Steep and non-transferable. The team absorbs three unfamiliar domains at once — ZeroMQ messaging patterns, ReactPHP's promise/loop model, and native dependency packaging — none of which are everyday Laravel skills. Realistically 2–4 weeks before a team is productive and longer before they are confident in production. Weigh that against the timeline of the workload it is meant to serve.

Bottom line. Score 3.38 with an opportunity score of 27.35 reflects the reality: a technically interesting, narrowly applicable, effectively unmaintained binding. For a Laravel shop the default answer is do not adopt into the core platform. Sanction it only for a single, well-bounded, high-volume messaging edge case where the latency requirement is quantified, the container image work is already funded, and a named owner accepts the fork. Otherwise, Redis Streams or SQS will deliver 90% of the outcome at 10% of the operational burden.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route