wpkit/queue

There is no license information available for the latest version (1.0.5) of this package.

A simple queue system for WPKit

1.0.5 2023-07-31 21:18 UTC

This package is not auto-updated.

Last update: 2024-12-19 05:24:58 UTC


README

This is a wp-kit component that provides a queue system when using Bedrock and Redis

Installation

composer require "wp-kit/queue"

Setup

Add Service Provider

Just register the service provider and facade in the providers config and theme config:

//inside theme/resources/config/providers.config.php

return [
	...,
    WPKit\Queue\QueueServiceProvider::class
];

How To Use

Make sure you have Redis installed on the server with default setup.

Examples of how what a Job file should look like can be found in the jobs folder.

Add these to you bedrock/root/jobs directory manually.

Make sure you are running the queue in a shell window, or via Supervisor:

vendor/bin/bedrock-queue-worker

You can then dispatch jobs within your wp-kit code as follows:

ExampleJob::dispatch('bar');

You should then see the string bar echo'd in the shell window.

Also, in bedrock/root/logs folder there will be a queue file, you could open it or tail it and see the following:

2019-10-29 15:34:40 Processing: Bedrock\Jobs\ExampleJob
2019-10-29 15:34:42 Processed: Bedrock\Jobs\ExampleJob

Get Involved

To learn more about how to use wp-kit check out the docs:

View the Docs

Any help is appreciated. The project is open-source and we encourage you to participate. You can contribute to the project in multiple ways by:

  • Reporting a bug issue
  • Suggesting features
  • Sending a pull request with code fix or feature
  • Following the project on GitHub
  • Sharing the project around your community

For details about contributing to the framework, please check the contribution guide.

Requirements

Wordpress 4+

PHP 5.6+

Redis

License

wp-kit/queue is open-sourced software licensed under the MIT License.