Application for Queue , using swoole and Lamins
Installation instructions:
If you have never used composer before make sure you read the
Composer Basic Usagesection in Composer's documentation
Example:
- absolute path
/var/www/pong - or relative path
pong(equivalent with./pong)
After choosing the path for DotKernel (pong will be used for the remainder of this example) it must be installed.
This method requires more manual input, but it ensures that the default branch is installed, even if it is not released. Run the following command:
$ git clone https://github.com/dotkernel/pong.git .The dependencies have to be installed separately, by running this command
$ composer installThe setup asks for configuration settings regarding injections (type 0 and hit enter) and a confirmation to use this setting for other packages (type y and hit enter)
- Remove the
.distextension from the filesconfig/autoload/local.php.dist,config/autoload/redis.local.php.dist,config/autoload/swoole.local.php.dist - Edit
config/autoload/local.phpaccording to your dev machine
Note: Do not enable dev mode in production
- Run the following commands in your project's directory ( in different tabs ):
$ redis-cli
$ php bin/dot-swoole start
$ php bin/cli.php process
$ php bin/cli.php resultNOTE: If you are still getting exceptions or errors regarding some missing services, try running the following command
$ php bin/clear-config-cache.phpapp-main.service
[Unit]
Description=pong startup service
StartLimitIntervalSec=1
[Service]
#The dummy program will exit
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetapp-process-queue.service
[Unit]
Description=Queue startup service
After=mysqld.service
PartOf=app-main.service
StartLimitIntervalSec=1
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/php /var/www/html/app-directory/bin/cli.php process
[Install]
WantedBy=app-main.serviceapp-result-queue.service
[Unit]
Description=Queue result service
After=mysqld.service
PartOf=app-main.service
StartLimitIntervalSec=1
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/php /var/www/html/app-directory/bin/cli.php result
[Install]
WantedBy=app-main.serviceapp-swoole.service
[Unit]
Description=pong startup service
After=mysqld.service
PartOf=app-main.service
StartLimitIntervalSec=1
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/php /var/www/html/app-directory/bin/dot-swoole start
ExecStop=/usr/bin/php /var/www/html/app-directory/bin/dot-swoole stop
[Install]
WantedBy=app-main.service