Me: Why I have put the observeOn(AndroidSchedulars.mainThread()) but still onNext() is NOT called in android main thread?!
Rx Master: Show me your code.
Me: Here you are my master. I just want to wait for 5 seconds then call an api:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) fun networkObservable(): Observable<String> { return Observable.just("test").subscribeOn(Schedulers.io()) } Observable.timer(5, TimeUnit.SECONDS) .observeOn(AndroidSchedulers.mainThread()) .flatMap { _ -> networkObservable() } .subscribe(Consumer { Log.d("testtest", it) Log.d("testtest", Thread.currentThread().name) }) } } Rx Master: … Read the Doc of observeOn:
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Tagged Data At the end of previous post, we identified one problem of our current complex number system, which is given a complex number, there is no way to tell whether it is implemented in rectangular form or polar form.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
When I first read about data directed programming in the book, I was surprised.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Representing Tables We can build a table data structure by just using pairs.
Do you think Computer Science equals building websites and mobile apps?
Are you feeling that you are doing repetitive and not so intelligent work?
Are you feeling a bit sick about reading manuals and copy-pasting code and keep poking around until it works all day long?
Do you want to understand the soul of Computer Science?
If yes, read SICP!!!
Mutable List Structure We introduce 2 operations to change a list: set-car!