PHPackages                             kfosoft/yii2-daemon - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kfosoft/yii2-daemon

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

kfosoft/yii2-daemon
===================

Extension provides functionality for simple daemons creation and control

20.09(5y ago)02732MITPHPPHP &gt;=7.2

Since Mar 17Pushed 5y agoCompare

[ Source](https://github.com/kfosoft/yii2-daemon)[ Packagist](https://packagist.org/packages/kfosoft/yii2-daemon)[ RSS](/packages/kfosoft-yii2-daemon/feed)WikiDiscussions master Synced today

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

Daemons system for Yii2
=======================

[](#daemons-system-for-yii2)

Extension provides functionality for simple daemons creation and control

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist kfosoft/yii2-daemon "*"

```

or add

```
"kfosoft/yii2-daemon": "*"

```

to the require section of your `composer.json` file.

### Setting SingleJob

[](#setting-singlejob)

1. Create command class and implement the SingleJobInterface.
2. Implement logic in `__invoke` method and please return time for sleep from `sleepTime` method.

### Setting WatcherDaemon

[](#setting-watcherdaemon)

WatcherDaemon is the main daemon and provides from box. This daemon check another daemons and run, if it need. Do the following steps:

1. Create in you console controllers path file WatcherDaemonController.php with following content:

```
