{"action":"created","issue":{"url":"https://api.github.com/repos/jxcore/jxcore/issues/457","labels_url":"https://api.github.com/repos/jxcore/jxcore/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/jxcore/jxcore/issues/457/comments","events_url":"https://api.github.com/repos/jxcore/jxcore/issues/457/events","html_url":"https://github.com/jxcore/jxcore/issues/457","id":95962635,"number":457,"title":"Why forking not supported in native application, how to ensure embedded app threads restart","user":{"login":"ruffrey","id":1668190,"avatar_url":"https://avatars.githubusercontent.com/u/1668190?v=3","gravatar_id":"","url":"https://api.github.com/users/ruffrey","html_url":"https://github.com/ruffrey","followers_url":"https://api.github.com/users/ruffrey/followers","following_url":"https://api.github.com/users/ruffrey/following{/other_user}","gists_url":"https://api.github.com/users/ruffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ruffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruffrey/subscriptions","organizations_url":"https://api.github.com/users/ruffrey/orgs","repos_url":"https://api.github.com/users/ruffrey/repos","events_url":"https://api.github.com/users/ruffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ruffrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-20T00:36:01Z","updated_at":"2015-07-20T13:26:52Z","closed_at":null,"body":"Hi, jxcore is really cool so far but I am trying to understand why I am getting this error when doing a standard `cluster.fork()`.\r\n\r\n```\r\nforking a child process is not supported for embedded applications. Try multithreaded tasks Error: forking a child process is not supported for embedded applications. Try multithreaded tasks\r\n```\r\n\r\nLooking at the source, it seems this was intentional:\r\n\r\n- https://github.com/jxcore/jxcore/blame/master/lib/child_process.js#L515\r\n\r\nI have been trying to get multithreading working for a simple net server, but it only restarts dead threads a few times and then the entire application shuts down. I have not had this problem with normal node cluster.\r\n\r\nWhy was this exception added? But perhaps more importantly, is there a reason why threads would not restart after a few times?\r\n\r\n\r\n```javascript\r\nfunction method(args) {\r\n    process.title = 'kval_worker_' + process.threadId;\r\n    console.log('kval worker', process.threadId, args);\r\n    setTimeout(function () {\r\n        throw new Error('Whoopsie daisy');\r\n    }, 5000 * (Math.random() + 1));\r\n    process.keepAlive();\r\n    process.on('restart', function (restartCallback) {\r\n        console.log('subprocess restart event', process.threadId);\r\n        restartCallback();\r\n    });\r\n}\r\n\r\njxcore.tasks.setThreadCount(args.workers);\r\njxcore.tasks.runOnce(method, args);\r\n```"},"comment":{"url":"https://api.github.com/repos/jxcore/jxcore/issues/comments/122884034","html_url":"https://github.com/jxcore/jxcore/issues/457#issuecomment-122884034","issue_url":"https://api.github.com/repos/jxcore/jxcore/issues/457","id":122884034,"user":{"login":"ruffrey","id":1668190,"avatar_url":"https://avatars.githubusercontent.com/u/1668190?v=3","gravatar_id":"","url":"https://api.github.com/users/ruffrey","html_url":"https://github.com/ruffrey","followers_url":"https://api.github.com/users/ruffrey/followers","following_url":"https://api.github.com/users/ruffrey/following{/other_user}","gists_url":"https://api.github.com/users/ruffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ruffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruffrey/subscriptions","organizations_url":"https://api.github.com/users/ruffrey/orgs","repos_url":"https://api.github.com/users/ruffrey/repos","events_url":"https://api.github.com/users/ruffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ruffrey/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T13:26:52Z","updated_at":"2015-07-20T13:26:52Z","body":"@ktrzeciaknubisa that would be wonderful."}}