Download the PHP package nashgao/mqtt without Composer
On this page you can find all versions of the php package nashgao/mqtt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package mqtt
Short Description encapsulation of mqtt client based on simps mqtt
License MIT
Informations about the package mqtt
Coroutine MQTT Client Integration With Hyperf Framework
This library uses simps/mqtt, please see [https://mqtt.simps.io/#/en/]() for compatibility
This library supports MQTT 5 only
Installation
publish config
Design Purpose
Shared Subscription is a new feature introduced by MQTT 5. It allows multiple subscribers to subscribe a same topic while only one of them receives the message at a time
As the Chart demonstrated, subscriber 1,2,3 belongs to the same group under , where is the constant prefix of the topic.
While msg 1,2,3 is published gradually, only one of the subscriber within the group will receive the message instead of all of them ( is special case for shared subscription, with group became a constant string as ).
In order to make the subscription easier, this library was designed and integrated with Hyperf framework. The library uses simps/mqtt which is the first php mqtt library that support MQTT 5 for basic mqtt broker interaction.
Usage
-
Subscribe
- Auto subscribe:
- For each topic defined under your , if the is enabled as true, the mentioned topic will be subscribed once the hyperf server is started.
- If the is enabled as true, then it would short circuit the shared topic options
- option is enabled as true, then numbers of client will be created to subscribe corresponding topic
- option represents to the option mentioned above it the design purpose section
- Manual subscribe (in these cases, the shared subscription needs to be handled manually)
-
dispatch event
- call directly
-
Publish
-
dispatch
- call directly
-
All versions of mqtt with dependencies
hyperf/di Version ~3.0
hyperf/framework Version ~3.1
hyperf/event Version ~3.1
hyperf/pool Version ~3.1
hyperf/logger Version ~3.1
hyperf/config Version ~3.1
simps/mqtt Version ~2.0