mirror of
https://github.com/akaessens/NoFbEventScraper
synced 2025-06-05 23:29:13 +02:00
Replace asyncTasks execute with actual parallel async execution
Using executeOnExecutor(asyncTask.THREAD_POOL_EXECUTOR) all pages are scraped in parallel. Related: #33 Note: with Android 11 the whole Aync Task is deprecated, therefore needs to be replaced in the future.
This commit is contained in:
@ -154,7 +154,7 @@ public class FbScraper {
|
|||||||
void scrapeEvent(String event_url) {
|
void scrapeEvent(String event_url) {
|
||||||
FbEventScraper scraper = new FbEventScraper(this, event_url);
|
FbEventScraper scraper = new FbEventScraper(this, event_url);
|
||||||
tasks.add(scraper);
|
tasks.add(scraper);
|
||||||
scraper.execute();
|
scraper.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -183,7 +183,7 @@ public class FbScraper {
|
|||||||
FbPageScraper scraper = new FbPageScraper(this, page_url);
|
FbPageScraper scraper = new FbPageScraper(this, page_url);
|
||||||
|
|
||||||
tasks.add(scraper);
|
tasks.add(scraper);
|
||||||
scraper.execute();
|
scraper.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -215,7 +215,7 @@ public class FbScraper {
|
|||||||
|
|
||||||
Log.d("scraperLog", "redirectUrl: "+url);
|
Log.d("scraperLog", "redirectUrl: "+url);
|
||||||
|
|
||||||
resolver.execute();
|
resolver.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
protected void redirectionResultCallback(String url) {
|
protected void redirectionResultCallback(String url) {
|
||||||
this.input_url = url;
|
this.input_url = url;
|
||||||
|
Reference in New Issue
Block a user