dexamped/kohana-resque

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

Kohana wrapper for php-resque with minion support.

1.0 2013-12-06 03:23 UTC

This package is not auto-updated.

Last update: 2024-04-13 14:45:12 UTC


README

A Kohana module for queuing asynchronous tasks though php-resque.

  1. Installation
  2. Writing Tasks
  3. Use with minion

Installation

Install the module

git submodule add git@github.com:dexamped/kohana-resque.git modules/kohana-resque
git submodule update --init --recursive

Load dependencies

We have to load vendor's dependencies by running composer install

composer install --working-dir=modules/kohana-resque/vendor/php-resque

Configuration

Edit application/bootstrap.php and add the module:

Kohana::modules(array(
    ...
    'resque' => 'modules/kohana-resque',
    ...
));

Copy the modules/kohana-resque/config/resque.php to APPPATH/config/resque.php and setup your config.

Running workers

From the shell: ./modules/kohana-resque/resque

Writing Tasks

Create a new Task: application/classes/Task/Mytask.php

class Task_Test extends Task_Resque {

	protected $_queue = 'myqueuename';

	public function perform()
	{
		echo "Executing a task!\n";
	}

} // End Task_Test

Use with Minion

Documentation coming