Hi all,
Our team is using flarum as a backend to provide API for a WhatsApp-like app for our company: https://www.zhishiq.com
A key feature of this app is, when flarum receives a reply in a discussion, it will broadcast an event to all clients, so that these clients can fetch the reply in time.
An existing plugin implementing this feature is flarum/pusher. But there is a drawback of flarum/pusher, that the response will be blocked until the request to pusher.com completes. It makes our user wait longer till server responds.
During the development of the app, we hope requests can respond very quickly. So we build an alternative version of flarum/pusher called zhishiq/flarum-pusher, which leverages zhishiq/flarum-queue to send requests asynchronously to avoid response being blocked when requesting pusher.com.
zhishiq/flarum-queue depends on illuminate/queue of laravel. We write two commands, queue:listen and queue:work in flarum style, with the corresponding code in illuminate/queue.
zhishiq/flarum-queue currently implements the queue with the help of redis, so we also build a plugin zhishiq/flarum-redis to register RedisServiceProvider and provide redis settings panel in flarum extension page.
Flarum has saved a lot of time when building this app. So we publish the plugins as a thanks to flarum community. And we also hope it can help others in our community when you hope to add asynchronous feature to your flarum.
zhishiq/flarum-pusher : https://packagist.org/packages/zhishiq/flarum-pusher
zhishiq/flarum-queue : https://packagist.org/packages/zhishiq/flarum-queue
zhishiq/flarum-redis : https://packagist.org/packages/zhishiq/flarum-redis