Skip to content

Commit

Permalink
Merge pull request #99 from mouyong/patch-1
Browse files Browse the repository at this point in the history
chore: 更新注释 callback => callable|null
  • Loading branch information
walkor authored Oct 25, 2022
2 parents 5b47eb9 + 1ab1116 commit aefdc21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
15 changes: 8 additions & 7 deletions src/BusinessWorker.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of workerman.
*
Expand Down Expand Up @@ -61,7 +62,7 @@ class BusinessWorker extends Worker
/**
* 业务超时时间,可用来定位程序卡在哪里
*
* @var callable
* @var callable|null
*/
public $processTimeoutHandler = '\\Workerman\\Worker::log';

Expand All @@ -82,21 +83,21 @@ class BusinessWorker extends Worker
/**
* 保存用户设置的 worker 启动回调
*
* @var callback
* @var callable|null
*/
protected $_onWorkerStart = null;

/**
* 保存用户设置的 workerReload 回调
*
* @var callback
* @var callable|null
*/
protected $_onWorkerReload = null;

/**
* 保存用户设置的 workerStop 回调
*
* @var callback
* @var callable|null
*/
protected $_onWorkerStop= null;

Expand Down Expand Up @@ -131,21 +132,21 @@ class BusinessWorker extends Worker
/**
* Event::onConnect 回调
*
* @var callback
* @var callable|null
*/
protected $_eventOnConnect = null;

/**
* Event::onMessage 回调
*
* @var callback
* @var callable|null
*/
protected $_eventOnMessage = null;

/**
* Event::onClose 回调
*
* @var callback
* @var callable|null
*/
protected $_eventOnClose = null;

Expand Down
17 changes: 9 additions & 8 deletions src/Gateway.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of workerman.
*
Expand Down Expand Up @@ -107,7 +108,7 @@ class Gateway extends Worker
/**
* 路由函数
*
* @var callback
* @var callable|null
*/
public $router = null;

Expand Down Expand Up @@ -136,14 +137,14 @@ class Gateway extends Worker
/**
* BusinessWorker 连接成功之后触发
*
* @var callback|null
* @var callable|null
*/
public $onBusinessWorkerConnected = null;

/**
* BusinessWorker 关闭时触发
*
* @var callback|null
* @var callable|null
*/
public $onBusinessWorkerClose = null;

Expand Down Expand Up @@ -183,35 +184,35 @@ class Gateway extends Worker
/**
* 当 worker 启动时
*
* @var callback
* @var callable|null
*/
protected $_onWorkerStart = null;

/**
* 当有客户端连接时
*
* @var callback
* @var callable|null
*/
protected $_onConnect = null;

/**
* 当客户端发来消息时
*
* @var callback
* @var callable|null
*/
protected $_onMessage = null;

/**
* 当客户端连接关闭时
*
* @var callback
* @var callable|null
*/
protected $_onClose = null;

/**
* 当 worker 停止时
*
* @var callback
* @var callable|null
*/
protected $_onWorkerStop = null;

Expand Down

0 comments on commit aefdc21

Please sign in to comment.