Giter VIP home page Giter VIP logo

filequeue's Introduction

FileQueue (Laravel4 Package)

Latest Stable Version Latest Unstable Version Total Downloads Build Status ProjectStatus

A simple queue implementation for laravel 4 that works with the filesystem. This can be used during development or when performance is not a concern (such as interacting with intermittent third party services).

Features

  • File based storage of queued jobs.
  • Uses built-in json_encode and json_decode for job storage.
  • Works with closures as well as classes.
  • Automatic retry logic on a dynamically increasing delay.

Quick Start

Simply add FileQueue to your composer.json file.

"mcpruitt/file-queue":"dev-master"

You'll then need to run composer install to download it and have the class autoloader updated.

After composer has installed FileQueue you will need to add the service provider. Edit app/config/app.php and updated the providers array.

'providers' => array(
  // Existing providers...
  'Mcpruitt\FileQueue\FileQueueServiceProvider',
 )

Finally you'll need to add the new queue to your app/config/queue.php and add a new entry to your connections array specifying the file driver.

'file' => array(
  'driver' => 'file'
)

You can now use your queue like normal.

Queue::push("DoSomething", array("Foo"=>"Bar"));

Configuration Options

driver - This is the driver for the queue. This should be set to file.

directory - (default: storage\FileQueue) - This is the directory where job files should be stored.

defaultqueue (default: default) - This is the name of the default queue to place jobs under.

bubleexceptions (default: false) - If true exceptions that are thrown when a job is fired will be allowed to bubble up. If false exceptions will be caught and logged and the job will be released (with an incremented attempt count).

Example of default configuration:
'file' => array(
  'driver' => 'file',
  'directory' => null,
  'defaultqueue' => 'default',
  'bubbleexceptions' => false
)

Directory Structure

By default the queue stores its job files in the storage\FileQueue folder. This folder can be overridden by specifying the directory option when configuring the queue. Within this directory another folder will be created for each queue name encountered (i.e. default). Within the name folder an inprocess folder will be created which holds jobs out of the standard queue folder while they are being processed.

Job File Names

Job files are named in a uniform manner: job-[JobName]-[TimeStamp]-[AttemptCount].json i.e. job-MyQueuedJob-12700000.0001-0.json

filequeue's People

Contributors

mcpruitt avatar

Stargazers

 avatar Danijel Dedic avatar

Watchers

 avatar

Forkers

pro85 thinkbox

filequeue's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.