Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增子服务支持心跳检测 #33

Open
kiss291323003 opened this issue Nov 4, 2018 · 6 comments
Open

新增子服务支持心跳检测 #33

kiss291323003 opened this issue Nov 4, 2018 · 6 comments

Comments

@kiss291323003
Copy link

伪代码如下:

$server = new swoole_http_server();
$sub1 = $server->addlisten(9501);
$sub2 = $server->addlisten(9502);
$sub1->set([
       'heartbeat_check_interval' => $config['EXPIRE'],
       'heartbeat_idle_time'      => $config['EXPIRE'],
]);
$sub2->set([
       'heartbeat_check_interval' => $config['EXPIRE'],
       'heartbeat_idle_time'      => $config['EXPIRE'],
]);

需要以上支持原因如下:
在经典的多服务案例中,例如只能家居硬件的开发中。我一个树莓派,搭建swoole server作为家庭网关。
现接入不同厂家的硬件设备。
门锁系列A: tcp:9501@15s ttl heartBeat
智能开关系列B:tcp:9502@30s ttl heartBeat

出于安全考虑,我需要在设备下线的时候,发出警告,特别是门锁,和门窗类。但是因为不同厂家的心跳周期不一样,或者说对于不同安全要求等级的设备,我心跳周期不一样。我需要对独立的某个子服务进行心跳周期检测。

@158code
Copy link

158code commented Nov 4, 2018

支持!

@windrunner414
Copy link

支持

@immortalChensm
Copy link

@xbing2002
Copy link

支持

2 similar comments
@shuyabin
Copy link

shuyabin commented Nov 4, 2018

支持

@yuntianhev
Copy link

支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants