Server.batch
Run planned mutations in order, resolving each to what it made.
Source and package
- Qualified name
-
Server.batch - Module
- server
- Declared in
Server- Package
- libtmux
- Source
- packages/libtmux/src/server.ts
- async batch< const T extends readonly Planned
Operation <unknown>[], >( operations: T, options?: CommandOptions , ): Promise<{ -readonly [K in keyof T]: T[K] extends PlannedOperation < infer R > ? R : never; }> -
Description#
The batched form of calling them one at a time: the same options go in and the same handles come out, positionally and individually typed. Calling
newWindow()repeatedly takes one snapshot after each mutation; a batch runs the mutations in order and resolves all of them from one final snapshot.Not atomic, for the same reason
Server.pipeline()is not: tmux runs them in order and stops at the first failure, leaving everything before it applied.Examples#
const [editor, logs] = await server.batch([session.plan.newWindow({ name: "editor" }),session.plan.newWindow({ name: "logs" }),]);- Type parameters
-
-
Bound readonly Planned
Operation <unknown>[]
-
- Parameters
-
-
operations(T) #
-
Guides#
Pages that discuss batch.