aaugustyniak/semithread
最新稳定版本:1.0.0
Composer 安装命令:
composer require aaugustyniak/semithread
包简介
Nohup interface simulating threaded env
README 文档
README
Simple API for starting non blocking jobs.
SemiThread
Right now this stuff works only under *nix systems. It's simple wrapper API for nohup exec call.
If you want i.e. send an email in process not attached to request/response cycle it is for you.
Installation
If you don’t have Composer yet, you should get it now.
-
Add the package to your
composer.json:"require": { ... "aaugustyniak/semithread": "1.0.0", ... } -
Install:
$ php composer.phar install -
And use:
First of all You must provide your implementations of:
- Aaugustyniak\SemiThread\Cloneable
- Aaugustyniak\SemiThread\SemiThread
examples are provided in Aaugustyniak\SemiThread\ExampleImpl.
<?php require_once "vendor/autoload.php"; $payload = new StringPayload("This is Payload"); $envelope = new ConfinedEnvelope($payload); $thread = new WriterThread($envelope); /** * Optional, redirect jobs output to file */ $thread->setOutput('/some/path/semi_threads.out'); $thread->start(); echo "Main process output\n"; ...
统计信息
- 总下载量: 973
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-10