Skip to content

Commit 9ba08d9

Browse files
v1.2.0 Release
ライブラリのバージョンアップに伴う修正 パラレルクラス生成のカスタムコマンド追加
1 parent 38a879a commit 9ba08d9

3 files changed

Lines changed: 69 additions & 1 deletion

File tree

commands/parallel/command.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
return [
4+
'name' => 'parallel',
5+
'description' => 'パラレルクラスの生成',
6+
'template' => 'template.php.tpl',
7+
'output' => 'app/ParallelClass/<%= name %>.php',
8+
];

commands/parallel/template.php.tpl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/**
3+
* パラレルクラスのファイル
4+
*
5+
* REST-APIサーバーのメイン処理クラスへ渡すためのクラスファイル
6+
*/
7+
8+
namespace App\ParallelClass;
9+
10+
11+
/**
12+
* パラレルクラス
13+
*
14+
* REST-APIサーバーのメイン処理クラスへ渡すためのクラス
15+
*/
16+
class <%= name %> implements IParallelClass
17+
{
18+
/**
19+
* コンストラクタ
20+
*
21+
* @param $p_context コンテキストクラスのインスタンス
22+
*/
23+
public function __construct($p_context)
24+
{
25+
}
26+
27+
/**
28+
* メイン処理の初期化処理
29+
*
30+
* 初期化処理の依存性注入
31+
*
32+
* @return bool true(成功) or false(失敗)
33+
*/
34+
public function initMain(): bool
35+
{
36+
/**
37+
* ここにメイン処理の初期化処理を実装します
38+
*/
39+
40+
return true;
41+
}
42+
43+
/**
44+
* 周期ドリブン処理
45+
*
46+
* イベントループへの依存性注入
47+
*
48+
* @param int $p_cycle_interval REST-APIの周期インターバルタイム(マイクロ秒)
49+
* @param int $p_alive_interval REST-APIのアライブチェックインターバルタイム(秒)
50+
* @return bool true(成功) or false(失敗)
51+
*/
52+
public function cycleDriven(int $p_cycle_interval, int $p_alive_interval): bool
53+
{
54+
/**
55+
* ここにイベントループ内の処理を実装します
56+
*/
57+
58+
return true;
59+
}
60+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
],
4444
"minimum-stability": "stable",
4545
"require": {
46-
"socket-manager/library": "~1.21.0",
46+
"socket-manager/library": "~1.22.0",
4747
"laminas/laminas-diactoros": "^3.8"
4848
},
4949
"repositories": {

0 commit comments

Comments
 (0)