Hacker News new | ask | show | jobs
by bexp 3939 days ago
Facebook using java.util.concurrent.Future<T> interface for downloading task: see here

https://github.com/facebook/fresco/blob/c5e1d4cf2c081bf871f5...

you can ether call future.cancel() or cancel(true): in first case download task will be finished but further processing in pipeline will be stopped. Future.cancel(true) is more aggressive and abandons download but you will get InterruptedException. As you see from source code Facebook using less aggressive approach with future.cancel(false) call.