Package io.deephaven.web.client.api
Class WorkerConnection
java.lang.Object
io.deephaven.web.client.api.WorkerConnection
Non-exported class, manages the connection to a given worker server. Exported types like QueryInfo and Table will
refer to this, and allow us to try to keep track of how many open tables there are, so we can close the connection if
not in use.
Might make more sense to be part of QueryInfo, but this way we can WeakMap instances, check periodically if any
QueryInfos are left alive or event handlers still exist, and close connections that seem unused.
Except for the delegated call from QueryInfo.getTable, none of these calls will be possible in Connecting or
Disconnected state if done right. Failed state is possible, and we will want to think more about handling, possible
re-Promise-ing all of the things, or just return stale values if we have them.
Responsible for reconnecting to the query server when required - when that server disappears, and at least one table
is left un-closed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
elemental2.promise.Promise<JsTable>
emptyTable
(double size) void
exportedTableUpdateMessage
(TableTicket clientId, long size) void
void
getBatcher
(JsTable table) getCache()
elemental2.promise.Promise<JsFigure>
getFigure
(JsVariableDefinition varDef) elemental2.promise.Promise<JsTreeTable>
elemental2.promise.Promise<?>
getJsObject
(jsinterop.base.JsPropertyMap<Object> definitionObject) elemental2.promise.Promise<?>
getObject
(TypedTicket typedTicket) elemental2.promise.Promise<?>
getObject
(JsVariableDefinition definition) elemental2.promise.Promise<JsPartitionedTable>
elemental2.promise.Promise<?>
getSharedObject
(SharedExportBytesUnion sharedExportBytes, String type) elemental2.promise.Promise<JsTable>
getTable
(JsVariableDefinition varDef, Boolean applyPreviewColumns) elemental2.promise.Promise<JsVariableDefinition>
getVariableDefinition
(String name, String type) elemental2.promise.Promise<JsWidget>
getWidget
(TypedTicket typedTicket) elemental2.promise.Promise<JsWidget>
getWidget
(JsVariableDefinition varDef) boolean
isUsable()
elemental2.promise.Promise<JsTable>
mergeTables
(JsTable[] tables, HasEventHandling failHandler) metadata()
elemental2.promise.Promise<ClientTableState>
newState
(HasEventHandling failHandler, JsTableFetch fetcher, String fetchSummary) newState
(JsTableFetch fetcher, String fetchSummary) newState
(ClientTableState from, TableConfig to) newState
(ClientTableState from, TableConfig to, TableTicket handle) newStateFromUnsolicitedTable
(ExportedTableCreationResponse unsolicitedTable, String fetchSummary) elemental2.promise.Promise<JsTable>
newTable
(String[] columnNames, String[] types, Object[][] data, String userTimeZone, HasEventHandling failHandler) void
void
onOpen
(BiConsumer<Void, String> callback) void
void
releaseHandle
(TableTicket handle) void
releaseTicket
(Ticket ticket) Releases the ticket, indicating no client using this session will reference it any more.void
scheduleCheck
(ClientTableState state) Schedules a deferred command to check the given state for active tables.void
setSessionTimeoutMs
(double sessionTimeoutMs) elemental2.promise.Promise<SharedExportBytesUnion>
shareObject
(ServerObject object, SharedExportBytesUnion sharedTicketBytes) <ReqT,
RespT>
BiDiStream.Factory<ReqT,RespT> subscribeToFieldUpdates
(JsConsumer<JsVariableChanges> callback) subscribeToLogs
(JsConsumer<LogItem> callback) elemental2.promise.Promise<JsTable>
timeTable
(double periodNanos, DateWrapper startTime) void
elemental2.promise.Promise<Object>
whenServerReady
(String operationName)
-
Constructor Details
-
WorkerConnection
-
-
Method Details
-
checkStatus
-
exportedTableUpdateMessage
-
connectionLost
public void connectionLost() -
forceReconnect
@JsMethod public void forceReconnect() -
forceClose
@JsMethod public void forceClose() -
setSessionTimeoutMs
public void setSessionTimeoutMs(double sessionTimeoutMs) -
onError
-
getVariableDefinition
public elemental2.promise.Promise<JsVariableDefinition> getVariableDefinition(String name, String type) -
getTable
public elemental2.promise.Promise<JsTable> getTable(JsVariableDefinition varDef, @Nullable Boolean applyPreviewColumns) -
getObject
-
getJsObject
public elemental2.promise.Promise<?> getJsObject(jsinterop.base.JsPropertyMap<Object> definitionObject) -
getObject
-
whenServerReady
-
getPartitionedTable
public elemental2.promise.Promise<JsPartitionedTable> getPartitionedTable(JsVariableDefinition varDef) -
getHierarchicalTable
-
getFigure
-
getWidget
-
getWidget
-
registerSimpleReconnectable
-
unregisterSimpleReconnectable
-
tableServiceClient
-
consoleServiceClient
-
sessionServiceClient
-
flightServiceClient
-
browserFlightServiceClient
-
inputTableServiceClient
-
objectServiceClient
-
partitionedTableServiceClient
-
storageServiceClient
-
configServiceClient
-
hierarchicalTableServiceClient
-
metadata
-
streamFactory
-
newTable
-
mergeTables
public elemental2.promise.Promise<JsTable> mergeTables(JsTable[] tables, HasEventHandling failHandler) -
getBatcher
-
newStateFromUnsolicitedTable
public ClientTableState newStateFromUnsolicitedTable(ExportedTableCreationResponse unsolicitedTable, String fetchSummary) -
newState
-
newState
public elemental2.promise.Promise<ClientTableState> newState(HasEventHandling failHandler, JsTableFetch fetcher, String fetchSummary) - Parameters:
fetcher
- The lambda to perform the fetch of the table's definition.- Returns:
- A promise that will resolve when the ClientTableState is RUNNING (and fail if anything goes awry). TODO: consider a fetch timeout.
-
newState
-
newState
-
getCache
-
scheduleCheck
Schedules a deferred command to check the given state for active tables. -
releaseHandle
-
releaseTicket
Releases the ticket, indicating no client using this session will reference it any more.- Parameters:
ticket
- the ticket to release
-
getReviver
-
isUsable
public boolean isUsable() -
getTickets
-
getServerConfigValue
-
onOpen
-
dump
-
emptyTable
-
timeTable
-