As we already covered in the previous chapters, an Observable and the operators that we use on it will execute and notify the observer on the same thread on which the subscribe operator is used. So far, we have done a lot of work on the main thread. Schedulers are an abstraction that lets us specify distinct queues on which to perform the work. It is always a good idea to move intensive work off the main thread to keep the app responsive for users. Schedulers make it easy to do this.
Scheduler can be serial or concurrent. We use serial schedulers if we want to ensure that the work is carried out on that queue in the order in which it was added to the queue. Otherwise, we can just use a concurrent queue. In this chapter, we will learn about the following topics:
- Queues and schedulers
- Scheduler Singletons
- ConcurrentDispatchQueueScheduler
- SerialDispatchQueueScheduler...