{"action":"created","issue":{"url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/399","repository_url":"https://api.github.com/repos/ratchetphp/Ratchet","labels_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/399/comments","events_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/399/events","html_url":"https://github.com/ratchetphp/Ratchet/issues/399","id":132630561,"number":399,"title":"Long tasks in onMessage","user":{"login":"dragonnn","id":1771469,"avatar_url":"https://avatars.githubusercontent.com/u/1771469?v=3","gravatar_id":"","url":"https://api.github.com/users/dragonnn","html_url":"https://github.com/dragonnn","followers_url":"https://api.github.com/users/dragonnn/followers","following_url":"https://api.github.com/users/dragonnn/following{/other_user}","gists_url":"https://api.github.com/users/dragonnn/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonnn/subscriptions","organizations_url":"https://api.github.com/users/dragonnn/orgs","repos_url":"https://api.github.com/users/dragonnn/repos","events_url":"https://api.github.com/users/dragonnn/events{/privacy}","received_events_url":"https://api.github.com/users/dragonnn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ratchetphp/Ratchet/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-10T07:55:22Z","updated_at":"2016-02-11T06:41:35Z","closed_at":null,"body":"Hi!\r\nI have a question - I am running some long tasks in onMessage with can take up to ~5s and I am not sure if this tasks will lock the server for this time to respond to other messages.\r\nAs far I know Ratchet is event based, so that schould be not a problem, I am right?"},"comment":{"url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/comments/182738286","html_url":"https://github.com/ratchetphp/Ratchet/issues/399#issuecomment-182738286","issue_url":"https://api.github.com/repos/ratchetphp/Ratchet/issues/399","id":182738286,"user":{"login":"RogerWaters","id":1272565,"avatar_url":"https://avatars.githubusercontent.com/u/1272565?v=3","gravatar_id":"","url":"https://api.github.com/users/RogerWaters","html_url":"https://github.com/RogerWaters","followers_url":"https://api.github.com/users/RogerWaters/followers","following_url":"https://api.github.com/users/RogerWaters/following{/other_user}","gists_url":"https://api.github.com/users/RogerWaters/gists{/gist_id}","starred_url":"https://api.github.com/users/RogerWaters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RogerWaters/subscriptions","organizations_url":"https://api.github.com/users/RogerWaters/orgs","repos_url":"https://api.github.com/users/RogerWaters/repos","events_url":"https://api.github.com/users/RogerWaters/events{/privacy}","received_events_url":"https://api.github.com/users/RogerWaters/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T06:41:35Z","updated_at":"2016-02-11T06:41:35Z","body":"Tried with PHP5.5 and 5.6 using libevent. Every handler registered to the loop in the thread is executed in the main process as there is the loop->run(). Also pthreads has removed condition and mutex so the interaction between threads is limited. The new monitor function is implemented in the base library but currently not in the php wrapper. Also we use some more libraries like inotify that results in segfault in some cases. Another propblem is that pthread convert every array exchanged into Threaded so you have to copy and convert between array and Threaded multiple times depending on your environment.\r\n\r\nIf it fits your needs its for sure the best solution but for me it's not as flexible and stable as required."}}