Skip to content

mikelbring/Pheanstalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pheanstalk for Laravel

Simple wrapper for Pheanstalk. Added static and dynamic loading.

Installation

Copy the config file to application/config/pheanstalk.php and update with your connection information

Usage

<?php

// ----------------------------------------
// producer (queues jobs)

// You can change the connection by changing the first parameter `Pheanstalk::connection('beanstalk1')`, connecitons are handled in the config
Pheanstalk::connection()
  ->useTube('testtube')
  ->put("job payload goes here\n");

// Or dynamically load the default connection
Pheanstalk::useTube('testtube')->put("job payload goes here\n");

// ----------------------------------------
// worker (performs jobs)

$pheanstalk = Pheanstalk::connection();

$job = $pheanstalk
  ->watch('testtube')
  ->ignore('default')
  ->reserve();

echo $job->getData();

$pheanstalk->delete($job);

?>

About

Pheanstalk Laravel Bundle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages