Community
Participate
Working Groups
I have multiple customers using asynchronous reading of data via CompletableFuture. AFAIK we do not have yet support in Databinding for this constructed, e.g.: CompletableFuture<Person> p = serverCall(); Would be useful IMHO to allow to find this via databinding so that once the future finishes the databinding is updating the bound properties.
Jens, WDYT?
(In reply to Lars Vogel from comment #1) > Jens, WDYT? It sound like an interesting idea! I don't understand exactly what you're thinking. To have a CompletableFuture value propagated to the databinding framework I guess you have to do something like this today: IObservableValue<String> o = new WritableValue<>(); CompletableFuture<String> f = new CompletableFuture<>(); f.whenComplete((s, exc) -> { o.getRealm().asyncExec(() -> o.setValue(s))); Is the new functionality that you're suggesting a way to make this easier and more natural?
(In reply to Jens Lideström from comment #2) > (In reply to Lars Vogel from comment #1) > > Jens, WDYT? > > It sound like an interesting idea! > > I don't understand exactly what you're thinking. > > To have a CompletableFuture value propagated to the databinding framework I > guess you have to do something like this today: > > IObservableValue<String> o = new WritableValue<>(); > > CompletableFuture<String> f = new CompletableFuture<>(); > > f.whenComplete((s, exc) -> { > o.getRealm().asyncExec(() -> o.setValue(s))); > > Is the new functionality that you're suggesting a way to make this easier > and more natural? Thanks for the reply. Yes, I think the above coding could be easier. Maybe something like a WritableValueCompletableFuture which does the above automatically.