{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/5779","repository_url":"https://api.github.com/repos/netty/netty","labels_url":"https://api.github.com/repos/netty/netty/issues/5779/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/5779/comments","events_url":"https://api.github.com/repos/netty/netty/issues/5779/events","html_url":"https://github.com/netty/netty/issues/5779","id":174307982,"number":5779,"title":"Slices of EventLoopGroups","user":{"login":"rkapsi","id":191635,"avatar_url":"https://avatars.githubusercontent.com/u/191635?v=3","gravatar_id":"","url":"https://api.github.com/users/rkapsi","html_url":"https://github.com/rkapsi","followers_url":"https://api.github.com/users/rkapsi/followers","following_url":"https://api.github.com/users/rkapsi/following{/other_user}","gists_url":"https://api.github.com/users/rkapsi/gists{/gist_id}","starred_url":"https://api.github.com/users/rkapsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkapsi/subscriptions","organizations_url":"https://api.github.com/users/rkapsi/orgs","repos_url":"https://api.github.com/users/rkapsi/repos","events_url":"https://api.github.com/users/rkapsi/events{/privacy}","received_events_url":"https://api.github.com/users/rkapsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-08-31T15:43:01Z","updated_at":"2016-09-15T04:55:11Z","closed_at":null,"body":"Our Netty application listens on a few different ports and connects to many remote servers. Certain aspects of the application are re-configurable at runtime such as adding and removing individual servers or entire backends.\r\n\r\nIdeally I'd like to create ~2 EventLoopGroups and have all \"ServerBootstrap\" and \"Bootstrap\" instances share them. The problem in that scenario is that it's absolutely forbidden to use `shutdownGracefully(...)` as it'd take down the entire application. It'd be however a super handy feature for tearing down backends.\r\n\r\nRight now there is only a choice of risking the above or give every frontend and backend their own EventLoopGroup which will lead to a lot more Threads than necessary.\r\n\r\nI'm wondering if EventLoopGroups should be \"slicable\" where a slice of an EventLoopGroup shares its parent group's Threads but is otherwise separate in terms of shutdown logic? Something along the lines of this:\r\n\r\n```java\r\nbackend(EventLoopGroup group) {\r\n  Bootstrap bootstrap = new Bootstrap()\r\n    .group(group.slice())\r\n    .more(...);\r\n  \r\n  // ~~~ life of the backend comes to an end ~~~\r\n  bootstrap.config().group().shutdownGracefully();\r\n}\r\n```\r\n\r\nI looked a little bit at MultithreadEventLoopGroup's guts and I don't think it can simply be added without some bigger refactorings. Just throwing it out there for future thoughts."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/247234704","html_url":"https://github.com/netty/netty/issues/5779#issuecomment-247234704","issue_url":"https://api.github.com/repos/netty/netty/issues/5779","id":247234704,"user":{"login":"Scottmitch","id":7562868,"avatar_url":"https://avatars.githubusercontent.com/u/7562868?v=3","gravatar_id":"","url":"https://api.github.com/users/Scottmitch","html_url":"https://github.com/Scottmitch","followers_url":"https://api.github.com/users/Scottmitch/followers","following_url":"https://api.github.com/users/Scottmitch/following{/other_user}","gists_url":"https://api.github.com/users/Scottmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Scottmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scottmitch/subscriptions","organizations_url":"https://api.github.com/users/Scottmitch/orgs","repos_url":"https://api.github.com/users/Scottmitch/repos","events_url":"https://api.github.com/users/Scottmitch/events{/privacy}","received_events_url":"https://api.github.com/users/Scottmitch/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T04:55:11Z","updated_at":"2016-09-15T04:55:11Z","body":"IIRC wrapping the EventLoopGroups is not very practical for some of the issues mentioned by @rkapsi ... i think there are also some factory methods which use `this` that also cause problems..."}}
{"actor":{"display_login":"Scottmitch"}}