PHPackages                             royalcms/gearman - 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. royalcms/gearman

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

royalcms/gearman
================

The Royalcms gearman package.

v5.0.0(6y ago)05MITPHPPHP &gt;=5.5.9

Since Sep 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/royalcms/royalcms-gearman)[ Packagist](https://packagist.org/packages/royalcms/gearman)[ Docs](http://royalcms.cn)[ RSS](/packages/royalcms-gearman/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Description
===========

[](#description)

This package gives you the possibily to add gearman as native queue back-end service

\#Installation

first you need to add it to your composer.json

second, in `config/provider.php`, you need to comment out the native queue service provider

```
//'��Royalcms\Component\Queue\QueueServiceProvider',

```

and to put this instead:

```
'Royalcms\Component\Gearman\GearmanServiceProvider',

```

Then in your config/queue.php file you can add:

```
'default' => 'gearman',
'connections' => array(
    'gearman' => array(
        'driver' => 'gearman',
        'host'   => 'localserver.6min.local',
        'queue'  => 'default',
        'port'   => 4730,
        'timeout' => 1000 //milliseconds
    )
)

```

or, if you have multiple gearman servers:

```
'default' => 'gearman',
'connections' => array(
    'gearman' => array(
        'driver' => 'gearman',
        'hosts'  => array(
            array('host' => 'localserver.6min.local', 'port' => 4730),
            array('host' => 'localserver2.6min.local', 'port' => 4730),
        ),
        'queue'  => 'default',
        'timeout' => 1000 //milliseconds
    )
)

```

Then in your code you can add code as (this is the native way to add jobs to the queue):

```
Queue::push('SomeClass', array('message' => 'The data that should be available in the SomeClass@fire method'));

```

Small hint, you can call Namespaced classes and everything that is written in the docs of laravel for calling custom methods is valid here, too.

Example:
========

[](#example)

I add a "service" folder to my app folder and inside I create a file "SendMail.php" The code of the class is here:

```
