Event Queue Transport Interface (Queue/EventTransportInterface.php)

watchstate · src/Libs/Events/Queue/EventTransportInterface.php · php · MIT
automation, infra, chat, lang:php, tag:interface

Defines a standard contract for message queue operations including enqueueing, dequeuing, and acknowledgement. Use this to implement pluggable event-driven architectures.

// Source: https://github.com/arabcoders/watchstate | License: MIT | Copyright 2024 ArabCoders
// Provided via justclaw.it.com; keep this notice with the code.
<?php

declare(strict_types=1);

namespace App\Libs\Events\Queue;

interface EventTransportInterface
{
    /**
     * Push a new event envelope into the transport.
     */
    public function enqueue(EventEnvelope $envelope): EventEnvelope;

    /**
     * Claim up to the requested number of queued event envelopes.
     *
     * @return array<EventEnvelope>
     */
    public function dequeue(int $limit): array;

    /**
     * Acknowledge successful processing and remove the envelope from the transport.
     */
    public function ack(EventEnvelope $envelope): void;

    /**
     * Release a claimed envelope back to the transport f

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key