Skip to content

Dev - #1

Open
ArnabChatterjee20k wants to merge 18 commits into
mainfrom
dev
Open

Dev#1
ArnabChatterjee20k wants to merge 18 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR introduces an MQTT transport and packet-codec library with Swoole server/client support, MQTT 3.1.1 and 5.0 encoders, property handling, documentation, tests, and containerized CI.

  • Adds the Adapter, Server, and Client transport abstractions.
  • Implements MQTT packet parsing and version-specific packet encoders.
  • Adds unit and end-to-end tests across PHP 8.1–8.3.
  • Pins workflow actions and exports built test images to Docker.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/Mqtt/Client.php Implements TCP/TLS client connection, framed receive loops, callback registration, and socket lifecycle handling.
src/Mqtt/Adapter/Swoole.php Implements the Swoole-backed MQTT server adapter and delegates connection lifecycle events to application callbacks.
src/Mqtt/Packet.php Adds MQTT fixed-header parsing and shared wire-format primitives.
src/Mqtt/Packet/V5.php Adds MQTT 5.0 packet encoders with property-block support.
src/Mqtt/Properties.php Adds ordered MQTT 5.0 property-block encoding and parsing.
.github/workflows/tests.yml Adds a pinned, matrix-based Docker test workflow for PHP 8.1 through 8.3.

Reviews (7): Last reviewed commit: "load the built test image into the docke..." | Re-trigger Greptile

Comment thread src/Mqtt/Client.php
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
Comment thread .github/workflows/tests.yml Outdated
Comment thread src/Mqtt/Client.php
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
Comment thread src/Mqtt/Adapter/Swoole.php Outdated
The adapter pins worker_num to 1, so a single process holds every
connection and a plain array is a complete view. Apps that scale
workers keep their own authoritative connection state (as the Appwrite
MQTT messaging adapter does), so the transport list is a local
convenience — no need for a Swoole\Table's cross-worker guarantee.
Comment thread .github/workflows/tests.yml
The transport is a byte pipe: start/shutdown/send/close plus the
lifecycle hooks. It no longer tracks which fds are connected — an
application that needs that keeps its own map, learning of a client
from the CONNECT packet (onReceive) and of a drop from onClose, keyed
by whatever domain state it attaches to each fd. Removes getConnections
from the Adapter contract, the Swoole registry, and the Server wrapper.
outputs: type=cacheonly discarded the image that load: true and the
mqtt-<php>-dev tag were meant to export, so docker compose up rebuilt
it from scratch on every job. Drop the cacheonly output; the image is
now loaded and compose reuses it, while cache-from/cache-to still warm
the gha layer cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant