{"action":"created","issue":{"url":"https://api.github.com/repos/swoole/swoole-src/issues/605","repository_url":"https://api.github.com/repos/swoole/swoole-src","labels_url":"https://api.github.com/repos/swoole/swoole-src/issues/605/labels{/name}","comments_url":"https://api.github.com/repos/swoole/swoole-src/issues/605/comments","events_url":"https://api.github.com/repos/swoole/swoole-src/issues/605/events","html_url":"https://github.com/swoole/swoole-src/issues/605","id":144434284,"number":605,"title":"只要swoole一执行 我的cpu就100%了...什么情况","user":{"login":"jonny77","id":1962170,"avatar_url":"https://avatars.githubusercontent.com/u/1962170?v=3","gravatar_id":"","url":"https://api.github.com/users/jonny77","html_url":"https://github.com/jonny77","followers_url":"https://api.github.com/users/jonny77/followers","following_url":"https://api.github.com/users/jonny77/following{/other_user}","gists_url":"https://api.github.com/users/jonny77/gists{/gist_id}","starred_url":"https://api.github.com/users/jonny77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonny77/subscriptions","organizations_url":"https://api.github.com/users/jonny77/orgs","repos_url":"https://api.github.com/users/jonny77/repos","events_url":"https://api.github.com/users/jonny77/events{/privacy}","received_events_url":"https://api.github.com/users/jonny77/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-30T01:29:42Z","updated_at":"2016-03-30T11:26:06Z","closed_at":"2016-03-30T11:26:06Z","body":"就弄了个简单的timer ,模拟定时访问某一个接口程序\r\n服务器是腾讯云的  1核一g的配置. \r\n<?php \r\nclass Crontab_check_domain{\r\n\tprotected $serv = null;\r\n\tpublic function __construct(){\r\n\t\t$this->serv =  new swoole_server(\"127.0.0.1\", 9504);\r\n\t\t$this->serv->set(array('daemonize'=>1,'worker_num'=>1));\r\n\t\t$this->serv->on('WorkerStart',array($this,'WorkerStart'));\r\n\t\t$this->serv->on('Receive',array($this,'Receive'));\r\n\t\t$this->serv->on('Timer',array($this,'onTimer'));\r\n\t\t$this->serv->start();\r\n\t}\r\n\t\r\n\tpublic function onTimer($serv){\r\n\r\n\t\techo file_get_contents('http://www.123.com/check_phonenum/');\r\n\t}\r\n\t\r\n\tpublic function WorkerStart($serv){\r\n\t\t$serv->addtimer(120000);\r\n\t}\r\n\t\r\n\tpublic function Receive($serv){\r\n\t\r\n\t}\r\n\tpublic function Close($serv){\r\n\t\t\r\n\t}\r\n}\r\nnew Crontab_check_domain();"},"comment":{"url":"https://api.github.com/repos/swoole/swoole-src/issues/comments/203387269","html_url":"https://github.com/swoole/swoole-src/issues/605#issuecomment-203387269","issue_url":"https://api.github.com/repos/swoole/swoole-src/issues/605","id":203387269,"user":{"login":"matyhtf","id":2017766,"avatar_url":"https://avatars.githubusercontent.com/u/2017766?v=3","gravatar_id":"","url":"https://api.github.com/users/matyhtf","html_url":"https://github.com/matyhtf","followers_url":"https://api.github.com/users/matyhtf/followers","following_url":"https://api.github.com/users/matyhtf/following{/other_user}","gists_url":"https://api.github.com/users/matyhtf/gists{/gist_id}","starred_url":"https://api.github.com/users/matyhtf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matyhtf/subscriptions","organizations_url":"https://api.github.com/users/matyhtf/orgs","repos_url":"https://api.github.com/users/matyhtf/repos","events_url":"https://api.github.com/users/matyhtf/events{/privacy}","received_events_url":"https://api.github.com/users/matyhtf/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T11:26:06Z","updated_at":"2016-03-30T11:26:06Z","body":"不支持addtimer，致命错误了。"}}