Use dedicated model executor

pull/210/head
M66B 2 years ago
parent d286c3d49d
commit f864123540

@ -44,6 +44,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
public class ViewModelMessages extends ViewModel {
private AdapterMessage.ViewType last = AdapterMessage.ViewType.UNIFIED;
@ -67,6 +68,9 @@ public class ViewModelMessages extends ViewModel {
}
};
private static final ExecutorService executor =
Helper.getBackgroundExecutor(0, 0, 3, "model");
private static final int LOCAL_PAGE_SIZE = 50;
private static final int THREAD_PAGE_SIZE = 100;
private static final int REMOTE_PAGE_SIZE = 10;
@ -200,7 +204,7 @@ public class ViewModelMessages extends ViewModel {
break;
}
builder.setFetchExecutor(db.getQueryExecutor());
builder.setFetchExecutor(executor);
model = new Model(args, builder.build(), boundary);
models.put(viewType, model);

Loading…
Cancel
Save