All Projects → yiisoft → Yii2 Queue

yiisoft / Yii2 Queue

Licence: bsd-3-clause
Yii2 Queue Extension. Supports DB, Redis, RabbitMQ, Beanstalk and Gearman

Projects that are alternatives of or similar to Yii2 Queue

Yii Queue
Queue extension for Yii 3.0
Stars: ✭ 38 (-96.11%)
Mutual labels:  hacktoberfest, redis, rabbitmq, queue, amqp
Yii2 Async
Provides translucent api & queues for moving large tasks out of request context with SQL, Redis or AMQP.
Stars: ✭ 64 (-93.45%)
Mutual labels:  redis, yii2, queue, amqp
Node Celery
Celery client for Node.js
Stars: ✭ 648 (-33.67%)
Mutual labels:  redis, rabbitmq, queue, amqp
Enqueue Dev
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
Stars: ✭ 1,977 (+102.35%)
Mutual labels:  hacktoberfest, redis, rabbitmq, amqp
Machinery
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Stars: ✭ 5,821 (+495.8%)
Mutual labels:  redis, rabbitmq, queue, amqp
Laravel Queue Rabbitmq
RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.
Stars: ✭ 1,175 (+20.27%)
Mutual labels:  rabbitmq, queue, amqp
Garagemq
AMQP message broker implemented with golang
Stars: ✭ 153 (-84.34%)
Mutual labels:  rabbitmq, queue, amqp
Fennel
A task queue library for Python and Redis
Stars: ✭ 24 (-97.54%)
Mutual labels:  async, redis, queue
Yii2 Rabbitmq
RabbitMQ Extension for Yii2
Stars: ✭ 52 (-94.68%)
Mutual labels:  yii2, rabbitmq, amqp
Arq
Fast job queuing and RPC in python with asyncio and redis.
Stars: ✭ 695 (-28.86%)
Mutual labels:  async, redis, queue
Yii2 Redis
Yii 2 Redis extension.
Stars: ✭ 416 (-57.42%)
Mutual labels:  hacktoberfest, redis, yii2
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (-88.54%)
Mutual labels:  async, rabbitmq, amqp
Lapin
AMQP client library in Rust, with a clean, futures based API
Stars: ✭ 497 (-49.13%)
Mutual labels:  hacktoberfest, async, amqp
Fw Cloud Framework
基于springcloud全家桶开发分布式框架(支持oauth2认证授权、SSO登录、统一下单、微信公众号服务、Shardingdbc分库分表、常见服务监控、链路监控、异步日志、redis缓存等功能),实现基于Vue全家桶等前后端分离项目工程
Stars: ✭ 717 (-26.61%)
Mutual labels:  redis, rabbitmq
Bifrost
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件
Stars: ✭ 701 (-28.25%)
Mutual labels:  redis, rabbitmq
Nodock
Docker Compose for Node projects with Node, MySQL, Redis, MongoDB, NGINX, Apache2, Memcached, Certbot and RabbitMQ images
Stars: ✭ 734 (-24.87%)
Mutual labels:  redis, rabbitmq
Mall Swarm
mall-swarm是一套微服务商城系统,采用了 Spring Cloud Hoxton & Alibaba、Spring Boot 2.3、Oauth2、MyBatis、Docker、Elasticsearch、Kubernetes等核心技术,同时提供了基于Vue的管理后台方便快速搭建系统。mall-swarm在电商业务的基础集成了注册中心、配置中心、监控中心、网关等系统功能。文档齐全,附带全套Spring Cloud教程。
Stars: ✭ 7,874 (+705.94%)
Mutual labels:  redis, rabbitmq
Prologue
Prologue is an elegant web framework written in Nim.
Stars: ✭ 700 (-28.35%)
Mutual labels:  hacktoberfest, async
Luya
LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
Stars: ✭ 741 (-24.16%)
Mutual labels:  hacktoberfest, yii2
Goodskill
🐂基于springcloud +dubbo构建的模拟秒杀项目,模块化设计,集成了分库分表、elasticsearch🔍、gateway、mybatis-plus、spring-session等常用开源组件
Stars: ✭ 786 (-19.55%)
Mutual labels:  redis, rabbitmq

Yii2 Queue Extension


An extension for running tasks asynchronously via queues.

It supports queues based on DB, Redis, RabbitMQ, AMQP, Beanstalk, ActiveMQ and Gearman.

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer:

php composer.phar require --prefer-dist yiisoft/yii2-queue

Basic Usage

Each task which is sent to queue should be defined as a separate class. For example, if you need to download and save a file the class may look like the following:

class DownloadJob extends BaseObject implements \yii\queue\JobInterface
{
    public $url;
    public $file;
    
    public function execute($queue)
    {
        file_put_contents($this->file, file_get_contents($this->url));
    }
}

Here's how to send a task into the queue:

Yii::$app->queue->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));

To push a job into the queue that should run after 5 minutes:

Yii::$app->queue->delay(5 * 60)->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));

The exact way a task is executed depends on the used driver. Most drivers can be run using console commands, which the component automatically registers in your application.

This command obtains and executes tasks in a loop until the queue is empty:

yii queue/run

This command launches a daemon which infinitely queries the queue:

yii queue/listen

See the documentation for more details about driver specific console commands and their options.

The component also has the ability to track the status of a job which was pushed into queue.

// Push a job into the queue and get a message ID.
$id = Yii::$app->queue->push(new SomeJob());

// Check whether the job is waiting for execution.
Yii::$app->queue->isWaiting($id);

// Check whether a worker got the job from the queue and executes it.
Yii::$app->queue->isReserved($id);

// Check whether a worker has executed the job.
Yii::$app->queue->isDone($id);

For more details see the guide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].