realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Add first-class RxJava support for RealmUser asynchronous methods in v10 #6803

Open edualonso opened 4 years ago

edualonso commented 4 years ago

There are currently a series of asynchronous methods in the RealmUser class, e.g.

public RealmAsyncTask logOutAsync(RealmApp.Callback<RealmUser> callback)

This method requires passing a callback object and process the result asynchronously. This isn't a problem per se. However, in case this operation is carried out within a reactive stream, users would have to create an observable themselves and deal with the emission themselves as well.

Having methods like

public Single<RealmUser> logOut()

would simplify things quite dramatically for API consumers.

RealmBot commented 4 years ago

➤ Christan Melchior commented:

We need to determine if this is worth doing. Given that we already have native RxJava support elsewhere it might be, but RxJava3 is also out, and with soon incoming support for Coroutines we should probably evaluate this issue in a larger context.