objectbox/objectbox-java

Improve DataObserver reference holding

開放

#215 建立於 2017年10月16日

 (6 則留言) (0 個反應) (0 位負責人)Java (348 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (4,275 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I'm trying to use obervable queries to detect when the user is logged in my application in order to start fetching data in background with correct authorization token.

    ...
    userBox.query().build().subscribe().observe(users -> fetchUserData());
    ...
    boxStore.subscribe(User.class).observe(class -> fetchUserData());

First "live" query doesn't work whilst the second works fine whenever I put(user) a new user in the userBox.

Is this correct? I'm not sure from which thread the user is being inserted, might this be an issue? Does it make sense to use a "live" query to observe the insertion of new objects or is it just for changes in existing objects? Live queries would be great, for my application and are the main feature that made me pick ObjectBox, hope I can get it working.

貢獻者指南