Swift Combine, Changing Threads As You Want, ‘3’ Common Sense You Must Know

Three Common Sense About Combine and Thread

  1. You can change thread on subscriber
  2. You can change thread on publisher
  3. Some publisher must run on Background only

What threads are running?

Thread

[1] Change Thread On Subscriber with receive(on:)

Change Thread On Subscriber

[2] Change Thread On Publisher with subscribe(on: )

Change Thread On Publisher

[3] Some publisher must run on Background only

Some publisher runs only on Background

Conclusion

  1. You can change thread on subscriber
  2. You can change thread on publisher
  3. Some publisher must run on Background only

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
KD Knowledge Diet

KD Knowledge Diet

2.4K Followers

Software Engineer, Mobile Developer living in Seoul. I hate people using difficult words. Why not using simple words? Keep It Simple Stupid!