use of org.eclipse.sirius.components.collaborative.trees.dto.TreeRefreshedEventPayload in project sirius-components by eclipse-sirius.
the class TreeEventProcessor method refresh.
@Override
public void refresh(ChangeDescription changeDescription) {
if (this.shouldRefresh(changeDescription)) {
long start = System.currentTimeMillis();
Tree tree = this.refreshTree();
this.currentTree.set(tree);
if (this.sink.currentSubscriberCount() > 0) {
EmitResult emitResult = this.sink.tryEmitNext(new TreeRefreshedEventPayload(changeDescription.getInput().getId(), tree));
if (emitResult.isFailure()) {
// $NON-NLS-1$
String pattern = "An error has occurred while emitting a TreeRefreshedEventPayload: {}";
this.logger.warn(pattern, emitResult);
}
}
long end = System.currentTimeMillis();
this.timer.record(end - start, TimeUnit.MILLISECONDS);
}
}
use of org.eclipse.sirius.components.collaborative.trees.dto.TreeRefreshedEventPayload in project sirius-components by eclipse-sirius.
the class TreeEventProcessor method getOutputEvents.
@Override
public Flux<IPayload> getOutputEvents(IInput input) {
var initialRefresh = Mono.fromCallable(() -> new TreeRefreshedEventPayload(input.getId(), this.currentTree.get()));
var refreshEventFlux = Flux.concat(initialRefresh, this.sink.asFlux());
// @formatter:off
return Flux.merge(refreshEventFlux, this.subscriptionManager.getFlux(input));
// @formatter:on
}
Aggregations