当前位置: 首页>>代码示例>>PHP>>正文


PHP swoole_process::name方法代码示例

本文整理汇总了PHP中swoole_process::name方法的典型用法代码示例。如果您正苦于以下问题:PHP swoole_process::name方法的具体用法?PHP swoole_process::name怎么用?PHP swoole_process::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在swoole_process的用法示例。


在下文中一共展示了swoole_process::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: callback_process_function

function callback_process_function(swoole_process $worker)
{
    set_time_limit(300);
    $task = json_decode($worker->read(), true);
    $worker->name('crontab.php worker=' . $task['uniqid']);
    $Handle = new TimingCall_Handle($task);
    $Handle->upNextExecuteTime();
    $Handle->refreshStatistics();
    $Handle->Execute();
    $worker->exit(0);
}
开发者ID:imdaqian,项目名称:Hi-Timed,代码行数:11,代码来源:cmd.php

示例2: child_async

function child_async(swoole_process $worker)
{
    //echo "Worker: start. PID=".$worker->pid."\n";
    //recv data from master
    $GLOBALS['worker'] = $worker;
    global $argv;
    $worker->name("{$argv[0]}: worker");
    swoole_process::signal(SIGTERM, function ($signal_num) use($worker) {
        echo "signal call = {$signal_num}, #{$worker->pid}\n";
    });
    swoole_event_add($worker->pipe, function ($pipe) use($worker) {
        $recv = $worker->read();
        echo "From Master: {$recv}\n";
        $worker->write("hello master\n");
    });
}
开发者ID:stonegithubs,项目名称:swoole-game,代码行数:16,代码来源:server.php

示例3: function

 function child_async(swoole_process $worker)
 {
     //echo "Worker: start. PID=".$worker->pid."\n";
     global $argv;
     $worker->name("{$argv[0]}: worker #" . $worker->id . "/" . $this->worker_num);
     swoole_process::signal(SIGTERM, function ($signal_num) use($worker) {
         echo "signal call = {$signal_num}, #{$worker->pid}\n";
     });
     switch ($this->status) {
         case 'import':
             echo " worker #" . $worker->id . "/" . $this->worker_num . " enter status: " . $this->status . PHP_EOL;
             $this->import_data($worker);
             break;
         case '1-dim':
             echo " worker #" . $worker->id . "/" . $this->worker_num . " enter status: " . $this->status . PHP_EOL;
             $this->generate_1dim_rank($worker);
             break;
         case '2-dim':
             echo " worker #" . $worker->id . "/" . $this->worker_num . " enter status: " . $this->status . PHP_EOL;
             $this->generate_2dim_rank($worker);
             break;
         case '3-dim':
             echo " worker #" . $worker->id . "/" . $this->worker_num . " enter status: " . $this->status . PHP_EOL;
             $this->generate_3dim_rank($worker);
             break;
         default:
             break;
     }
     $worker->exit(0);
 }
开发者ID:shenxinyu,项目名称:redis_rank,代码行数:30,代码来源:paralle_rank.php


注:本文中的swoole_process::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。