Skip to content

Dev - #1

Open
ArnabChatterjee20k wants to merge 38 commits into
mainfrom
dev
Open

Dev#1
ArnabChatterjee20k wants to merge 38 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

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

The PR introduces an MQTT client, Swoole-backed server adapter, protocol codecs, broker state helpers, documentation, and PHP 8.1–8.3 CI.

  • Adds MQTT 3.1.1 and 5.0 packet encoding, decoding, and property handling.
  • Adds client/server transport lifecycle handling, subscription matching, keepalive scheduling, and connection state.
  • Adds unit and end-to-end tests, Docker environments, Composer metadata, and pinned CI actions.

Reviews (13) · Last reviewed commit: "fix: tear down the connection when a rec..."

Comment thread src/Mqtt/Client.php Outdated
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.
Comment thread composer.lock Outdated
Comment thread src/Mqtt/Client.php Outdated
A throwing onError or onClose handler skipped handleClose()/socket close,
leaving the client marked connected with the socket open, and let listen()
emit onError twice. Wrap the close and error emits in try/finally so the
socket always closes and the error is reported once.
Comment thread src/Mqtt/Client.php Outdated
receive()'s final emit('receive') was unguarded, so a throwing onReceive
escaped with the client still marked connected and its socket open. Guard
it like the other terminal paths: report via onError once, close in a
finally, and return null.
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