itm / wsn-device-drivers

Drivers for Wireless Sensor Network Devices
Other
6 stars 4 forks source link

Use TimeLimiter instead of Timer for timeout management #42

Closed mlegenhausen closed 13 years ago

mlegenhausen commented 13 years ago

This has several advantages:

  1. You can set the Executor for the TimeLimiter that would allow to set maximum thread amout for the whole application which is optimal for embedded devices. See issue #11
  2. There is no more PausableThreadExecutor necessary, cause the operation can be canceled inside the Operation instead outside of it. This will make several classes unnecessary.
  3. The TimeLimiter can be injected, which allows to set the ExecutorService.

<3 Google Guava ;)