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

5414 reconnect subscriptions #5501

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ private void flush() {
}
}
}
} else {
} else if (state.isRunning()) {
List<TableSubscriptionRequest> vps = new ArrayList<>();
state.forActiveSubscriptions((table, subscription) -> {
assert table.isActive(state) : "Inactive table has a viewport still attached";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import io.deephaven.web.client.api.barrage.WebBarrageUtils;
import io.deephaven.web.client.api.barrage.def.ColumnDefinition;
import io.deephaven.web.client.api.barrage.def.InitialTableDefinition;
import io.deephaven.web.client.api.barrage.def.TableAttributesDefinition;
import io.deephaven.web.client.api.batch.TableConfig;
import io.deephaven.web.client.api.filter.FilterCondition;
import io.deephaven.web.client.api.lifecycle.HasLifecycle;
Expand All @@ -28,12 +27,8 @@
import jsinterop.base.Js;

import java.util.*;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;

import static io.deephaven.web.client.api.barrage.WebBarrageUtils.keyValuePairs;
import static io.deephaven.web.client.fu.JsItr.iterate;

/**
Expand Down Expand Up @@ -251,13 +246,7 @@ public ClientTableState newState(TableTicket newHandle, TableConfig config) {

final ClientTableState newState = new ClientTableState(
connection, newHandle, sorts, conditions, filters, customColumns, dropColumns, viewColumns, this,
(c, s, metadata) -> {
// This fetcher will not be used for the initial fetch, only for refetches.
// Importantly, any CTS with a source (what we are creating here; source=this, above)
// is revived, it does not use the refetcher; we directly rebuild batch operations instead.
// It may make sense to actually have batches route through reviver instead.
connection.getReviver().revive(metadata, s);
}, config.toSummaryString());
null, config.toSummaryString());
newState.setFlat(config.isFlat());
if (!isRunning()) {
onFailed(reason -> newState.setResolution(ResolutionState.FAILED, reason), JsRunnable.doNothing());
Expand Down Expand Up @@ -991,6 +980,12 @@ public Promise<JsTable> fetchTable(HasEventHandling failHandler, BrowserHeaders
}

public Promise<ClientTableState> refetch(HasEventHandling failHandler, BrowserHeaders metadata) {
if (fetch == null) {
if (failMsg != null) {
return Promise.reject(failMsg);
}
return Promise.resolve(this);
}
final Promise<ExportedTableCreationResponse> promise =
Callbacks.grpcUnaryPromise(c -> fetch.fetch(c, this, metadata));
// noinspection unchecked
Expand Down
Loading