Reputation: 4069
Is it possible to schedule work on a dedicated background thread? I need to ensure the work is done in serial, but also it must be done on the background.
Basically - is there a combination of the trampoline
and io
schedulers out there?
Upvotes: 3
Views: 440
Reputation: 4002
Just use a ThreadPool with only one Thread.
RxJava2 provides such a standard Scheduler:
Schedulers.single()
Or use the Factory method:
Schedulers.from(Executors.newSingleThreadExecutor())
Upvotes: 3