o-fish-android icon indicating copy to clipboard operation
o-fish-android copied to clipboard

Shouldn't run Realm transactions/queries on the UI thread

Open am-MongoDB opened this issue 5 years ago • 6 comments

From review by Realm engineering team:

RealmDataSource run transactions and queries on the UI thread. This could potentially block the UI, and is bad practise when using Sync.

am-MongoDB avatar Sep 01 '20 11:09 am-MongoDB

@am-MongoDB where should the transactions and queries run?

Sheeri avatar Sep 01 '20 13:09 Sheeri

They should be run in a worker thread

am-MongoDB avatar Sep 01 '20 13:09 am-MongoDB

@Sheeri @am-MongoDB On Android we use Kotlin. We can easely start using Coroutines.. Are you agree with it?

lebedynskyi avatar Sep 01 '20 13:09 lebedynskyi

If coroutines are the correct way to ensure that slow operations don't block the UI, then yes, let's use them

am-MongoDB avatar Sep 01 '20 14:09 am-MongoDB

@lebedynskyi I am also OK with coroutines. Does that unblock this ticket?

Sheeri avatar Sep 15 '20 14:09 Sheeri

@Sheeri in General no. We are waiting for native support of Realm SDK

lebedynskyi avatar Sep 15 '20 14:09 lebedynskyi