DaveAKing / guava-libraries

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

Perhaps MoreExecutors.shutdownAndAwaitTermination() should return the unexecuted tasks #1728

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
That's what ExecutorService.shutdownNow() returns, and we call that method. But 
we ignore its return value. As a result, the caller has no way to get at the 
cancelled tasks. The method's actual return value, by contrast, is 
executor.isTerminated(), which the caller could check himself if he wanted. 
Furthermore, it appears that no internal users care about the return value 
currently.

The main counterargument is that shutdownAndAwaitTermination() is nothing but a 
convenience method, so the user can always call the ExecutorService methods 
directly if he wishes. But it's not clear to me that the proposed 
List<Runnable> return type is any less convenient than the current boolean.

Original issue reported on code.google.com by cpov...@google.com on 15 Apr 2014 at 3:36

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

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

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

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:07