{"action":"created","issue":{"url":"https://api.github.com/repos/swoole/swoole-src/issues/2118","repository_url":"https://api.github.com/repos/swoole/swoole-src","labels_url":"https://api.github.com/repos/swoole/swoole-src/issues/2118/labels{/name}","comments_url":"https://api.github.com/repos/swoole/swoole-src/issues/2118/comments","events_url":"https://api.github.com/repos/swoole/swoole-src/issues/2118/events","html_url":"https://github.com/swoole/swoole-src/issues/2118","id":380084942,"node_id":"MDU6SXNzdWUzODAwODQ5NDI=","number":2118,"title":"Procedural Oriented Programming in Swoole","user":{"login":"jobs-git","id":13552004,"node_id":"MDQ6VXNlcjEzNTUyMDA0","avatar_url":"https://avatars0.githubusercontent.com/u/13552004?v=4","gravatar_id":"","url":"https://api.github.com/users/jobs-git","html_url":"https://github.com/jobs-git","followers_url":"https://api.github.com/users/jobs-git/followers","following_url":"https://api.github.com/users/jobs-git/following{/other_user}","gists_url":"https://api.github.com/users/jobs-git/gists{/gist_id}","starred_url":"https://api.github.com/users/jobs-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobs-git/subscriptions","organizations_url":"https://api.github.com/users/jobs-git/orgs","repos_url":"https://api.github.com/users/jobs-git/repos","events_url":"https://api.github.com/users/jobs-git/events{/privacy}","received_events_url":"https://api.github.com/users/jobs-git/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-13T06:57:53Z","updated_at":"2018-11-13T16:26:25Z","closed_at":null,"author_association":"NONE","body":"I think we can still squeeze more performance in swoole through POP. For this particular code, how do we implement a procedural oriented programming of the following?\r\n\r\n```\r\n$http = new swoole_http_server(\"127.0.0.1\", 9501);\r\n$http->on('request', function ($request, $response) {\r\n    $response->end(\"<h1>Hello Swoole. #\".rand(1000, 9999).\"</h1>\");\r\n});\r\n$http->start();\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/swoole/swoole-src/issues/comments/438336016","html_url":"https://github.com/swoole/swoole-src/issues/2118#issuecomment-438336016","issue_url":"https://api.github.com/repos/swoole/swoole-src/issues/2118","id":438336016,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODMzNjAxNg==","user":{"login":"flddr","id":42785945,"node_id":"MDQ6VXNlcjQyNzg1OTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/42785945?v=4","gravatar_id":"","url":"https://api.github.com/users/flddr","html_url":"https://github.com/flddr","followers_url":"https://api.github.com/users/flddr/followers","following_url":"https://api.github.com/users/flddr/following{/other_user}","gists_url":"https://api.github.com/users/flddr/gists{/gist_id}","starred_url":"https://api.github.com/users/flddr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flddr/subscriptions","organizations_url":"https://api.github.com/users/flddr/orgs","repos_url":"https://api.github.com/users/flddr/repos","events_url":"https://api.github.com/users/flddr/events{/privacy}","received_events_url":"https://api.github.com/users/flddr/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T16:26:25Z","updated_at":"2018-11-13T16:26:25Z","author_association":"NONE","body":"> but isn't $http still declared as an object?\r\n\r\nYes, like everything in swoole. But you can work as you want above this.\r\n\r\nThe underlying itself is reactor-based eventloop which calls _on_ in this example and gives _request_ and _response_ objects you can work with (or on).\r\n\r\nCan you give an example code to better understand?"}}
{"actor":{"display_login":"flddr"}}