File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
objectbox-java/src/main/java/io/objectbox/reactive Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,20 @@ public SubscriptionBuilder<T> on(Scheduler scheduler) {
148
148
}
149
149
150
150
/**
151
- * Sets the observer for this subscription and requests the latest data to be delivered immediately.
152
- * Subscribes to receive data updates. This can be changed by using {@link #single()} or {@link #onlyChanges()}.
151
+ * Completes building the subscription by setting a {@link DataObserver} that receives the data.
153
152
* <p>
154
- * Results are delivered on a background thread owned by the internal data publisher,
155
- * unless a scheduler was set using {@link #on(Scheduler)} .
153
+ * By default, requests the latest data to be delivered immediately and on any future updates. To change this call
154
+ * {@link #single()} or {@link #onlyChanges()} before .
156
155
* <p>
157
- * The returned {@link DataSubscription} must be canceled once the observer should no longer receive data.
156
+ * By default, {@link DataObserver#onData(Object)} is called from an internal background thread. Change this by
157
+ * setting a custom scheduler using {@link #on(Scheduler)}. It may also get called for multiple observers at the
158
+ * same time. The order in which observers are called is the same as the subscription order, although this may
159
+ * change in the future.
160
+ * <p>
161
+ * Typically, keep a reference to the returned {@link DataSubscription} to avoid it getting garbage collected, to
162
+ * keep receiving new data.
163
+ * <p>
164
+ * Call {@link DataSubscription#cancel()} once the observer should no longer receive data.
158
165
*/
159
166
public DataSubscription observer (DataObserver <T > observer ) {
160
167
WeakDataObserver <T > weakObserver = null ;
You can’t perform that action at this time.
0 commit comments