Queue Message Model (src/Message.php)

appwrite · packages/queue/src/Message.php · php · BSD-3-Clause
automation, infra, chat, lang:php, tag:payload

Models a single message within the Appwrite queue system, tracking payload, delivery attempts, size, and processing state. Reuse it when implementing custom queue workers, task scheduling, or deferred job processing.

// Source: https://github.com/appwrite/appwrite | License: BSD-3-Clause | Copyright 2019 Appwrite (https://appwrite.io) and individual contributors
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace Utopia\Queue;

class Message
{
    public const int LARGE_SIZE = 1048576;

    protected string $pid;
    protected string $queue;
    protected int $timestamp;
    protected array $payload;
    protected int $attempts = 0;
    protected ?int $maxAttempts = null;
    protected ?int $sequence = null;
    protected bool $terminal = false;
    protected ?int $size = null;

    public function __construct(array $array = [])
    {
        if ($array === []) {
            return;
        }

        $this->pid = $array['pid'];
        $this->queue = $array['queue'];
    

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

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

Get a free API key