[TYRUS-200] [client] Provide facility for thread factory (worker & selector thread) Created: 18/Jun/13 Updated: 18/Jun/13 Resolved: 18/Jun/13
|Reporter:||Pavel Bucek||Assignee:||Pavel Bucek|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
From the developer's angle, perhaps they would like to see ExecutorService rather than Grizzly thread pool (even though grizzly's threadpool seems to offer more options) . For e.g.
ClientManager client = ClientManager.createClient();
I also prefer passing Map to ClientManager.createClient(Map<String, ?> props) so that changing properties after client is created would mean subtle behavioral changes.
|Comment by Pavel Bucek [ 18/Jun/13 ]|
Fixed in the trunk.
Now you can set worker and selector ThreadPoolConfig used by grizzly container when creating Tyrus client. Following sample only sets ThreadFactory, but there are many more options which you can modify (pool size, memory management, queues, ..)
See ThreadPoolConfig javadoc for more details: https://grizzly.java.net/docs/2.3/apidocs/org/glassfish/grizzly/threadpool/ThreadPoolConfig.html
feel free to comment/reopen if this solution is not sufficient for your usecase.