Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umermansoor/custom-future-wrapping-callable
For demonstrating how to return Customized Future from Executor Service
https://github.com/umermansoor/custom-future-wrapping-callable
Last synced: 7 days ago
JSON representation
For demonstrating how to return Customized Future from Executor Service
- Host: GitHub
- URL: https://github.com/umermansoor/custom-future-wrapping-callable
- Owner: umermansoor
- Created: 2013-03-01T22:46:43.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-02T00:16:21.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T04:22:49.994Z (9 months ago)
- Language: Java
- Size: 113 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This code given here explains how to return a custom FutureTask when you
submit a Callable to an ExecutorService. This is helpful in the following
cases:
1. To support Interruption-unfriendly task cancellation. java.net.Socket
operations are notoriously oblivious to interruptions. Hence, tasks using
Socket operations must support non-standard cancellation. (The best approach
to do this is to `close()` to Socket, forcing all of it's blocked methods
to throw SocketException.
2. To return an identifier for Callable. Useful when Tasks are assigned ID's
and could be used to track them.