{"action":"created","issue":{"url":"https://api.github.com/repos/Frederikam/FredBoat/issues/191","repository_url":"https://api.github.com/repos/Frederikam/FredBoat","labels_url":"https://api.github.com/repos/Frederikam/FredBoat/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/Frederikam/FredBoat/issues/191/comments","events_url":"https://api.github.com/repos/Frederikam/FredBoat/issues/191/events","html_url":"https://github.com/Frederikam/FredBoat/pull/191","id":236600461,"number":191,"title":"Use an executor for the processing of the agents","user":{"login":"Shredder121","id":4105066,"avatar_url":"https://avatars1.githubusercontent.com/u/4105066?v=3","gravatar_id":"","url":"https://api.github.com/users/Shredder121","html_url":"https://github.com/Shredder121","followers_url":"https://api.github.com/users/Shredder121/followers","following_url":"https://api.github.com/users/Shredder121/following{/other_user}","gists_url":"https://api.github.com/users/Shredder121/gists{/gist_id}","starred_url":"https://api.github.com/users/Shredder121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shredder121/subscriptions","organizations_url":"https://api.github.com/users/Shredder121/orgs","repos_url":"https://api.github.com/users/Shredder121/repos","events_url":"https://api.github.com/users/Shredder121/events{/privacy}","received_events_url":"https://api.github.com/users/Shredder121/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-06-16T21:26:37Z","updated_at":"2017-06-17T13:17:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Frederikam/FredBoat/pulls/191","html_url":"https://github.com/Frederikam/FredBoat/pull/191","diff_url":"https://github.com/Frederikam/FredBoat/pull/191.diff","patch_url":"https://github.com/Frederikam/FredBoat/pull/191.patch"},"body":"I wanted to wait with this one last, but I think it's also good to get some comments/feedback in.\r\nSo here goes.\r\n\r\nThis makes the point where agents are started unified, and cleans up the `//noinspection InfiniteLoopStatement while (true) {`, each one start a Thread, (correctly) configuring it, etc. mantra.\r\n\r\n\r\nCaveats/notes:\r\n\r\n- [x] This makes the starting/handling/rate-scheduling/stopping universal.\r\n- [ ] `log.info(\"starting xxx\")` should be either 1) removed, or 2) be accompanied by `log.info(\"finished xxx\")` or 3) be changed in logging level.\r\n- [x] Decide on whether to use `scheduleWithFixedDelay` (which was more akin to the previous code, since there were always fixed sleep intervals) or `scheduleAtFixedRate` (which makes more sense (?) when dealing with agents/cleanup units of work).\r\n- [ ] Decide whether a single worker thread is enough, or if a larger threadpool or a cached threadpool is better, so 2, 3, 4 threads? Or let the cached threadpool handle it?\r\n- [ ] Decide whether we use `AGENTS.awaitTermination()` in the shutdown, or do we just let it shutdown while we do other shutdown-y things?\r\n- [ ] Needs a lot of eyes on the code. I have been running this code for about/over a week or two, but that's different from when it would go live for thousands of servers.\r\n- [ ] Do not merge until all checks have been ticked, since other issues can be raised 😨. (I don't want to be *that guy who broke everything*)"},"comment":{"url":"https://api.github.com/repos/Frederikam/FredBoat/issues/comments/309214667","html_url":"https://github.com/Frederikam/FredBoat/pull/191#issuecomment-309214667","issue_url":"https://api.github.com/repos/Frederikam/FredBoat/issues/191","id":309214667,"user":{"login":"Shredder121","id":4105066,"avatar_url":"https://avatars1.githubusercontent.com/u/4105066?v=3","gravatar_id":"","url":"https://api.github.com/users/Shredder121","html_url":"https://github.com/Shredder121","followers_url":"https://api.github.com/users/Shredder121/followers","following_url":"https://api.github.com/users/Shredder121/following{/other_user}","gists_url":"https://api.github.com/users/Shredder121/gists{/gist_id}","starred_url":"https://api.github.com/users/Shredder121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shredder121/subscriptions","organizations_url":"https://api.github.com/users/Shredder121/orgs","repos_url":"https://api.github.com/users/Shredder121/repos","events_url":"https://api.github.com/users/Shredder121/events{/privacy}","received_events_url":"https://api.github.com/users/Shredder121/received_events","type":"User","site_admin":false},"created_at":"2017-06-17T13:17:44Z","updated_at":"2017-06-17T13:17:44Z","body":"> Actually in that situation we had to go over a thread dump and find the threads by name. So I think it's important to keep the agent's tasks independent from each other, and have a distinct name.\r\n\r\nWe can also introduce a ThreadGroup, so the spawned threads are grouped?\r\nBut maybe later, now just correctness."}}
{"actor":{"display_login":"Shredder121"}}