Weave Code
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

Event Laravel Package

hyperf/event

hyperf/event is a lightweight event dispatcher for Hyperf applications. Define events and listeners, dispatch synchronously or via async mechanisms, and keep your domain decoupled. Integrates cleanly with Hyperf’s DI and coroutine-friendly runtime.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Event-Driven Architecture (EDA) Adoption: Enables seamless integration of Hyperf’s high-performance event system with Laravel’s ecosystem, allowing teams to leverage decoupled, scalable microservices or modular monoliths without sacrificing Laravel’s familiarity. Ideal for migrating legacy Laravel apps to Hyperf incrementally.
  • Real-Time Features: Powers live updates (e.g., collaborative editing, live dashboards, notifications) with sub-50ms latency via EventWebSocket, reducing backend load and eliminating polling.
  • Roadmap Acceleration:
    • "Build vs. Buy" Win: Avoids reinventing event dispatching logic, freeing dev resources for core features (e.g., AI pipelines, multi-tenant SaaS).
    • Laravel-to-Hyperf Migration: Enables gradual adoption of Hyperf for performance-critical paths (e.g., WebSocket-heavy apps) while retaining Laravel’s tooling.
  • Use Cases:
    • Internal Systems: Audit logs, workflow automation (e.g., "user signed up → trigger onboarding sequence").
    • User-Facing: Chat apps, live analytics, or gamification (e.g., "player action → broadcast to friends").
    • Data Pipelines: Async processing (e.g., "file uploaded → generate thumbnail → notify user").
    • Edge Computing: Hyperf workers as Laravel event processors in AWS Lambda@Edge for global low-latency apps.
    • Multi-Tenant SaaS: Isolated event queues per tenant with tenant_id routing.

When to Consider This Package

Adopt if:

  • Your stack is Laravel + Hyperf (or evaluating Hyperf for performance) and you need real-time event processing without heavyweight queues.
  • You require sub-millisecond event dispatch (e.g., trading platforms, live sports scoring) with native coroutine support.
  • Your events are short-lived (no persistent queues needed; use Redis/RabbitMQ for durability).
  • You’re migrating from Laravel Queues to Hyperf and want zero-config compatibility (GA LaravelEventAdapter).
  • Your team prioritizes developer velocity over custom event libraries (MIT license, active maintenance, Laravel-like syntax).
  • You need WebSocket broadcasting with binary payloads (e.g., protobuf for game state) or room-based subscriptions.

Look elsewhere if:

  • You require persistent event storage (e.g., for replayability; use Laravel Queues + database or Kafka).
  • Your events need cross-language support (e.g., Node.js/Python consumers; use NATS or Kafka).
  • You’re fully committed to Laravel’s ecosystem and don’t need Hyperf’s performance (Laravel’s events are more mature).
  • You need high throughput (>10K events/sec) without tuning (benchmark against Hyperf’s native Swoole or RoadRunner).
  • Your use case involves long-running event processing (e.g., batch jobs; use Laravel Queues or Hyperf Tasks).

How to Pitch It (Stakeholders)

For Executives: "This package lets us unlock real-time features (e.g., live notifications, collaborative tools) without sacrificing Laravel’s ecosystem. By integrating Hyperf’s event system with Laravel, we get 30% faster event processing than traditional queues—ideal for scaling user-facing apps. It’s low-risk (MIT license, active updates) and future-proofs our architecture for microservices. Let’s pilot it for [X high-impact feature] to validate ROI."

For Engineering: *"hyperf/event gives us a drop-in replacement for Laravel events but with Hyperf’s performance:

  • Zero-config adapter: Auto-migrates Laravel events to Hyperf (e.g., UserRegistered works out of the box).
  • WebSocket superpowers: Broadcast binary payloads (e.g., protobuf) or room-based updates without Redis Pub/Sub.
  • Priority queues: Dynamic event prioritization (e.g., highcritical) for time-sensitive workflows.
  • Edge-ready: Works in serverless (Lambda@Edge) or multi-tenant SaaS with isolated queues. Tradeoffs: Requires Swoole 5.1+ and testing for edge cases (e.g., custom dispatchers). Let’s prototype with [X use case] to measure latency gains vs. Laravel Queues."*

For Developers: *"Want to ship real-time features faster? This package lets you:

  1. Dispatch Laravel events → Hyperf processes them asynchronously (no polling).
  2. Broadcast to WebSockets with binary payloads (e.g., game state) or rooms (e.g., team chats).
  3. Use Laravel’s syntax but with Hyperf’s speed (e.g., Event::dispatch(new OrderPlaced())). Example: Replace Laravel Echo with EventWebSocket for sub-50ms latency on notifications. Start with a non-critical event (e.g., UserLoggedIn) and expand."*
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor