承接 aaugustyniak/semithread 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aaugustyniak/semithread

最新稳定版本:1.0.0

Composer 安装命令:

composer require aaugustyniak/semithread

包简介

Nohup interface simulating threaded env

README 文档

README

Build Status

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.

  1. Add the package to your composer.json:

     "require": {
       ...
       "aaugustyniak/semithread": "1.0.0",
       ...
     }
    
  2. Install:

     $ php composer.phar install
    
  3. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-10