Skip to content
New issue

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

Real-Times Updates #425

Open
fdecampredon opened this issue Aug 17, 2015 · 20 comments
Open

Real-Times Updates #425

fdecampredon opened this issue Aug 17, 2015 · 20 comments

Comments

@fdecampredon
Copy link

Does Falcor support real-times updates? If not is it planned?

@jhusain
Copy link
Contributor

jhusain commented Aug 18, 2015

Will be opening a roadmap issue on this with more detail in the near future.

@jhusain
Copy link
Contributor

jhusain commented Aug 18, 2015

Short answer: yes.

@fdecampredon
Copy link
Author

I'm sorry but could you elaborate ?
Yes supported ? or yes planned ?

@jhusain
Copy link
Contributor

jhusain commented Aug 18, 2015

Sorry. It's not supported at the moment but we are considering ways in which it could be done.

@HighOnDrive
Copy link

+1

@almeynman
Copy link

Any news on real-time updates?

@sheerun
Copy link

sheerun commented Feb 5, 2016

I'd love this feature

@carlosvillu
Copy link

That will be great!!

@jordanh
Copy link

jordanh commented Feb 5, 2016

We're using a hybrid method for real-time updates in our app now: Falcor for initial load and pub/sub registration, then a websockets stream for objects as they change.

Sketching something out:

  1. A means of decorating a path (similar to invalidated: true) to indicate it's subscription status/disposition to modify a client's cache: perhaps subscribed: true or volatile: true

  2. A method to call on falcor-router to indicate path changes: object added to a range, object with range or key updated, object with range or key deleted.

Curious what thoughts the Falcor team might have...

@zanettin
Copy link

+1

1 similar comment
@tchap
Copy link

tchap commented Mar 8, 2016

👍

@ThePrimeagen
Copy link
Contributor

Real time updates are on our radar, but not something we are doing immediately. It may be solved by a related item and rolled into a near term feature. Team Falcor Is going to release the road map shortly.

@rob3c
Copy link

rob3c commented Jun 9, 2016

Until there is an official solution, how can we manipulate the local falcor client cache using an external source for the update events along the lines that @jordanh described?

@joshdmiller
Copy link

@rob3c Have your backend return an array of path values and use withoutDataSource to prevent calls to the http data source. E.g. something like this:

websocket.onmessage = res => model.withoutDataSource().set( ...res.data );

@rob3c
Copy link

rob3c commented Jun 9, 2016

@joshdmiller thanks! So the key is to use model.withoutDataSource() to only work with the local JSON Graph, and then make set() and/or invalidate() calls on it for local-only updates.

@nicholasleblanc
Copy link

Any update on official support for this? Also, is the roadmap mentioned above available yet - I couldn't find it. Thanks for all your hard work on this so far.

@sdesai
Copy link
Contributor

sdesai commented Oct 7, 2016

Hey Nicholas, it's not on the near term roadmap.

I'll get the roadmap out by the end of October

Sorry, I know we've been promising it for a while. We just have someone now (me) who has some cycles to put it together.

@bryanerayner
Copy link

Disclaimer: We are not currently using Falcor, but looking into using it as it could replace a lot of home-grown code which does the same things as JSON Graph.

@michaelbpaulson , @sdesai , is there an issue where the specs of this are being discussed?

From glancing at the API, it appears to me that ModelResponse would be where I would expect as an end user, the subscription to be. I think that onComplete would need to be called, when any of the requested paths were removed from the cache.

@sdesai
Copy link
Contributor

sdesai commented Oct 4, 2017

Just to loop back around on this. There aren't any active design discussions/specs on it currently. It's something we think we'd like to do, but we're actively thinking about near/medium term, so marking it 'longer term' as in, probably more than a year out.

@ludovicthomas
Copy link

For the record, we have done a fork of falcor-datasource, that is using socket.io: https://github.com/Mixgenius/Falcor-HTTP-WS-DataSource

We are using it in production since more than a year without any issue.

On the client side, the datasource is created using the server URL (model.json), and the websocket URL. There is a management of several connections for the same user using tabIdLabel property. Then there is callback onPushNotifications on the datasource that will be called when new data are receive. It's a JSONGraphResponse with potential invalidated and jsonGraph/paths properties. For each invalidated paths, we do falcorPromise.invalidate(path);, and for for the jsonGraph, falcorPromise.withoutDataSource().set(data).

Hope it could help some others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests