We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the use of this line if (subscriber.isUnsubscribed()) return;
if (subscriber.isUnsubscribed()) return;
in below code.
public Observable<Ribot> setRibots(final Collection<Ribot> newRibots) { return Observable.create(new Observable.OnSubscribe<Ribot>() { @Override public void call(Subscriber<? super Ribot> subscriber) { if (subscriber.isUnsubscribed()) return; BriteDatabase.Transaction transaction = mDb.newTransaction(); try { mDb.delete(Db.RibotProfileTable.TABLE_NAME, null); for (Ribot ribot : newRibots) { long result = mDb.insert(Db.RibotProfileTable.TABLE_NAME, Db.RibotProfileTable.toContentValues(ribot.profile()), SQLiteDatabase.CONFLICT_REPLACE); if (result >= 0) subscriber.onNext(ribot); } transaction.markSuccessful(); subscriber.onCompleted(); } finally { transaction.end(); } } }); }
Is it necessary to use it ??
The text was updated successfully, but these errors were encountered:
Yes, when using Observable.create() you need to check that the subscription is not unsubscribed before doing anything else.
Observable.create()
There is better operators than Observable.create() that you can use. See this issue #10 for more info.
Sorry, something went wrong.
Thanks
No branches or pull requests
What is the use of this line
if (subscriber.isUnsubscribed()) return;
in below code.
Is it necessary to use it ??
The text was updated successfully, but these errors were encountered: