Package io.deephaven.web.client.api
Class MicrotaskBatchImpl
java.lang.Object
io.deephaven.web.client.api.MicrotaskBatchImpl
- All Implemented Interfaces:
JsTableOperations,ServerObject
Implements the immutable table API over
ClientTableStates. Operations called on any instance are collected
per connection and sent as one BatchTableRequest when the current microtask ends; each operation owns a state
from the moment it is created, and the state's retainers decide when its ticket is released.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.web.client.api.JsTableOperations
JsTableOperations.DownsampleTableOptions, JsTableOperations.NaturalJoinType, JsTableOperations.RangeEndRule, JsTableOperations.RangeJoinMatch, JsTableOperations.RangeStartRule, JsTableOperations.SnapshotWhenOptions, JsTableOperations.UngroupOptionsNested classes/interfaces inherited from interface io.deephaven.web.client.api.ServerObject
ServerObject.Union -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMicrotaskBatchImpl(WorkerConnection connection, Ticket ticket) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringforeignOperand(WorkerConnection connection, JsTableReference... operands) Why a request onconnectionmust not nameoperands, ornullif all are on it: a ticket from another connection can name a different table on this one.static <T> elemental2.promise.Promise<T> holdUntil(WorkerConnection connection, Ticket[] tickets, Supplier<elemental2.promise.Promise<T>> call) Makes the gRPC callcallreturns, holding the tablesticketsname until it settles, for a request outside the batch that names them.static @Nullable StringoperandFailure(JsTableReference... operands) Why a request namingoperands' tickets outside the batch must fail now, ornullif it may be sent.static JsPendingTable<JsResolvedTable> operationsOf(WorkerConnection connection, ClientTableState state) The operations of aJsTable: a pending table over the state that table has now, which its later changes do not move.Internal method: a pending table that rejects withfailure, which each operation returns instead of throwing, as an async function would.static <T extends JsITable>
JsPendingTable<T> wrap(WorkerConnection connection, ClientTableState state, elemental2.promise.Promise<ClientTableState> fetched, Function<ClientTableState, T> build) Presents a fetched state as a pending table, so operations can be chained on it before the fetch completes.static <T extends JsITable>
JsPendingTable<T> wrapWithOperands(WorkerConnection connection, ClientTableState state, JsTableReference[] operands, Function<ClientTableState, T> build) Aswrap(io.deephaven.web.client.api.WorkerConnection, io.deephaven.web.client.state.ClientTableState, elemental2.promise.Promise<io.deephaven.web.client.state.ClientTableState>, java.util.function.Function<io.deephaven.web.client.state.ClientTableState, T>), for a state not yet fetched whose request namesoperands' tickets outside the batch.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.web.client.api.JsTableOperations
absSumBy, aggAllBy, aggBy, aj, avgBy, call, call, countBy, downsample, dropColumns, exactJoin, firstBy, flatten, groupBy, head, join, lastBy, lazyUpdate, maxBy, medianBy, minBy, naturalJoin, raj, rangeJoin, reverse, select, selectDistinct, slice, snapshot, snapshotWhen, sort, stdBy, sumBy, tail, ungroup, update, updateBy, updateView, varBy, view, wavgBy, where, whereIn, whereNotIn, wsumBy
-
Field Details
-
connection
-
ticket
-
-
Constructor Details
-
MicrotaskBatchImpl
-
-
Method Details
-
operationsOf
public static JsPendingTable<JsResolvedTable> operationsOf(WorkerConnection connection, ClientTableState state) The operations of aJsTable: a pending table over the state that table has now, which its later changes do not move. -
wrap
public static <T extends JsITable> JsPendingTable<T> wrap(WorkerConnection connection, ClientTableState state, elemental2.promise.Promise<ClientTableState> fetched, Function<ClientTableState, T> build) Presents a fetched state as a pending table, so operations can be chained on it before the fetch completes.fetchedis the already-issued fetch ofstate;buildmakes the table the first awaiter receives, over the fetched state, and is called at most once. A pending that nobody awaits or chains on is released when the fetch completes. -
wrapWithOperands
public static <T extends JsITable> JsPendingTable<T> wrapWithOperands(WorkerConnection connection, ClientTableState state, JsTableReference[] operands, Function<ClientTableState, T> build) Aswrap(io.deephaven.web.client.api.WorkerConnection, io.deephaven.web.client.state.ClientTableState, elemental2.promise.Promise<io.deephaven.web.client.state.ClientTableState>, java.util.function.Function<io.deephaven.web.client.state.ClientTableState, T>), for a state not yet fetched whose request namesoperands' tickets outside the batch. The operands are checked and held as a batch operation's are: if one cannot be used, the pending fails and nothing is sent; otherwise each is held until the state settles, and one that fails first fails the pending. -
operandFailure
Why a request namingoperands' tickets outside the batch must fail now, ornullif it may be sent. A pending operand that was canceled, failed, or used after its task may never define its ticket on the server, so the request would wait forever. -
holdUntil
public static <T> elemental2.promise.Promise<T> holdUntil(WorkerConnection connection, Ticket[] tickets, Supplier<elemental2.promise.Promise<T>> call) Makes the gRPC callcallreturns, holding the tablesticketsname until it settles, for a request outside the batch that names them. The result is the call's, unless a held table fails or is released first: the server may then never answer, so the result rejects at once and the tables are let go. Canceling a pending table after the call is sent has no other effect on it: a table that already exists on the server stays usable there, and the call cannot be withdrawn. -
foreignOperand
public static @Nullable String foreignOperand(WorkerConnection connection, JsTableReference... operands) Why a request onconnectionmust not nameoperands, ornullif all are on it: a ticket from another connection can name a different table on this one. -
rejected
Description copied from interface:JsTableOperationsInternal method: a pending table that rejects withfailure, which each operation returns instead of throwing, as an async function would.- Specified by:
rejectedin interfaceJsTableOperations
-
typedTicket
- Specified by:
typedTicketin interfaceServerObject
-
getConnection
- Specified by:
getConnectionin interfaceServerObject
-