PHPackages                             mead-steve/mon-work-go - 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. [Database &amp; ORM](/categories/database)
4. /
5. mead-steve/mon-work-go

Abandoned → [mead-steve/mon-work-go](/?search=mead-steve%2Fmon-work-go)Library[Database &amp; ORM](/categories/database)

mead-steve/mon-work-go
======================

A simple mongo DB based work queue.

v2.0.0(12y ago)116MITPHPPHP &gt;=5.4

Since Mar 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/meadsteve/MonWorkGo)[ Packagist](https://packagist.org/packages/mead-steve/mon-work-go)[ RSS](/packages/mead-steve-mon-work-go/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (7)Used By (0)

MonWorkGo
=========

[](#monworkgo)

Simple work queue built on top of mongodb. A single collection in mongoDB is used to represent one work queue. A json payload is used to desribe the work which is then processed by a supplied callback.

master: [![Build Status](https://camo.githubusercontent.com/b541dfd410456ebf24281356d2bc9a254f21cb4bd4262789baff4e1e5a065eb0/68747470733a2f2f7472617669732d63692e6f72672f6d65616473746576652f4d6f6e576f726b476f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/meadsteve/MonWorkGo)develop: [![Build Status](https://camo.githubusercontent.com/3b4f031fef68dfe836baf439892486d75adc744293007331665469ea36f83cc1/68747470733a2f2f7472617669732d63692e6f72672f6d65616473746576652f4d6f6e576f726b476f2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/meadsteve/MonWorkGo)

Installation
------------

[](#installation)

The easiest way to install this library is using composer. In your project's composer.json file add:

```
{
    "require": {
        "mead-steve/mon-work-go": "2.0.*"
    }
}

```

Then run composer update.

Queueing up work
----------------

[](#queueing-up-work)

A mixed array of data describing your work can get queued for processing. This will be quick so you can respond to your user like a hero. This will create a collection called mainQueue in your mongoDB (if it doesn't already exist).

```
$manager = new \MeadSteve\MonWorkGo\Manager($mongoDB);

$manager->getQueue("mainQueue")
    ->clearCompletedWork()      // Do a bit of house keeping
    ->addWork(["jobOne", 34])
    ->addWork([5, 7])
    ->addWork([8])
    ->addWork(["jobFour", "mead"])
    ->addWork(["jobFive", "beer"]);
```

Processing Work
---------------

[](#processing-work)

Once your data has been nicely queued you can spend a bit more time processing it. To be honest you'll probably want to do a little more than echoing it but this should give you the idea. This script will run indefinitely and there's nothing stopping you having it running on multiple instances to share the load.

```
$manager = new \MeadSteve\MonWorkGo\Manager($mongoDB);

$manager->createWorker(
    "mainQueue",
    function ($payload) {
        echo "Hello. I'm working on: " . var_export($payload, true);
        return \MeadSteve\MonWorkGo\Worker::WORK_RESPONSE_SUCCESS;
    }
)->start();
```

Reporting on the progress of the work
-------------------------------------

[](#reporting-on-the-progress-of-the-work)

The worker object can also be provided with a psr logger. In addition to sending debug messages to this logger the work function also gets passed the logger as the second argument so can report on its own progress.

```
$manager = (new \MeadSteve\MonWorkGo\Manager($mongoDB))->setLogger($logger);

$manager->createWorker(
    "mainQueue",
    function ($payload, \Psr\Log\LoggerInterface $log) {
        $log->info("Hello logger");
        $log->info("I should probably do some work");
        return \MeadSteve\MonWorkGo\Worker::WORK_RESPONSE_SUCCESS;
    }
)->start();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

4420d ago

Major Versions

v1.1.2 → v2.0.02014-04-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f6a1fc7be44918da7cc299d340d1e27b338e2396c2f2ca389857b4e2e197c4b?d=identicon)[MeadSteve](/maintainers/MeadSteve)

---

Top Contributors

[![meadsteve](https://avatars.githubusercontent.com/u/1663120?v=4)](https://github.com/meadsteve "meadsteve (31 commits)")

---

Tags

messageprocessingqueuejobmongodbmongowork

### Embed Badge

![Health badge](/badges/mead-steve-mon-work-go/health.svg)

```
[![Health](https://phpackages.com/badges/mead-steve-mon-work-go/health.svg)](https://phpackages.com/packages/mead-steve-mon-work-go)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[mmucklo/queue-bundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

120839.8k](/packages/mmucklo-queue-bundle)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[sokil/php-mongo

PHP Object Document Mapper for MongoDB

239161.5k9](/packages/sokil-php-mongo)[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

114542.8k6](/packages/apix-cache)[sonata-project/doctrine-mongodb-admin-bundle

Symfony Sonata / Integrate Doctrine MongoDB ODM into the SonataAdminBundle

68839.2k3](/packages/sonata-project-doctrine-mongodb-admin-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
