PHPackages                             journey/queue - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. journey/queue

ActiveLibrary[Queues &amp; Workers](/categories/queues)

journey/queue
=============

Simple, hierarchical action-test-callback queue written in php

v0.2.2(11y ago)027MITPHPPHP &gt;=5.4.0

Since Dec 10Pushed 11y ago2 watchersCompare

[ Source](https://github.com/journeygroup/queue)[ Packagist](https://packagist.org/packages/journey/queue)[ RSS](/packages/journey-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Journey Queue
-------------

[](#journey-queue)

Queue is a simple, hierarchical action-test-callback queue written in php. The php thread waits however long is necessary in order to complete the entire queue (using Journey\\Daemon).

Install
-------

[](#install)

Use composer to install it and load it.

Use
---

[](#use)

The queue is made up of a registry of `QueueItem` objects. Each `QueueItem` has 3 elements:

- Action
    - `__construct(Callable)`
    - `setAction(Callable)`
- Check
    - `unitl(Callable)`
    - `succeedWhen(Callable)`
- Callback
    - `then(Callable)`
    - `after(Callable)`

The queue first performs the action. The queue will then call the check to determine if the action has completed until it receives a truthy value. Finally the queue will call the callback after the check passes.

```
