Similar to pinterest pinboard flow, Fully written using various amazing features of android and java like ExecutorService, Executors, Future, Handler, Looper, Threads, Runnable, Callable, json, http, BlockingDeque, Hashtable, WeakReferences, RecyclerView, various CustomViews...etc
For geting a file from url, call
IFThreadPoolHandler.getInstance().getFile(Stringtag, Stringurl, FileTypetype, newCallback.IFCallBack(){
@OverridepublicvoidonSuccess(@NonNullTaskModeltaskModel) {
super.onSuccess(taskModel)
}
@OverridepublicvoidonError(@NonNullStringmessage) {
super.onError(message);
Log.d("onError", message);
}
});For canceling all task, call
IFThreadPoolHandler.getInstance().stopAndClearAllThreads();For canceling any particular task, call
IFThreadPoolHandler.getInstance().removeTask(Stringtag);todo: proper testing and profiling
