DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Add convience methods to ThreadFactoryBuilder #1555

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After 18 months of real-world usage, I'm filing a successor to #943. We end up 
having the following two helper methods in all of our code:

  threadsNamed(String nameformat)
  daemonThreadsNamed(String nameformat)

These methods are always used used when creating an Executor (having un-named 
threads is a no-no):

  private final Executor executor = newCachedThreadPool(daemonThreadsNamed("server-%s"));

The regular vs daemon variants are useful because the choice of having a daemon 
thread is always a coding-time issue (you need to shutdown non-daemon 
executors) and having it spelled out in the method name makes it easier to read.

Original issue reported on code.google.com by electrum on 15 Oct 2013 at 1:01

GoogleCodeExporter commented 9 years ago

Original comment by kak@google.com on 11 Nov 2013 at 3:39

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08