Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-26-2020 10:59 PM
Right now, I'm hesitating between 2 options:
userOnline
and userOffline
, and each client must update a local array of online users via a cache merge type policy. Not sure how to re-render the cached array data when one of the subscriptions gets new data.usersOnline
returning the list of users, and the client only needs to compare previous and new data to figure out who's just logged in and who's just logged out. On the server side, the subscription triggers a reactive session transaction to toggle a User.isOnline
boolean, and returns the list of all Users matching isOnline=true.Which way would you choose for such a feature? Or do you have an alternative suggestion that might be simpler/more efficient?
10-26-2020 11:19 PM
I might have found a simpler solution.
useLazyQuery
to get all online users, with the hook option subscribeToMore
to get further updates (the internals of subscribeToMore are obscure to me, will need to dive into it).10-30-2020 05:35 AM
It's not going to help you right now, however, I've got it on pretty good authority that the GRANDstack will be adding in subscription support soon. Which could possibly make this quite a bit easier.
All the sessions of the conference are now available online