mirror of
https://github.com/lancedb/lancedb.git
synced 2026-09-04 04:28:44 +00:00
e3b472c212
Adds job operations to the connection surface, building on the Job handle from #3742: job(id), list_jobs, get_job, cancel_job, and job_history, plus a non-blocking Job.status(). Implemented on the Database trait (defaulting to NotSupported), the remote backend (/v1/jobs), and the Python and Node bindings; job_history returns Arrow batches. errors() and progress() are not included. Tested with mocked endpoints in all three languages. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
84 lines
1.1 KiB
Markdown
84 lines
1.1 KiB
Markdown
[**@lancedb/lancedb**](../README.md) • **Docs**
|
|
|
|
***
|
|
|
|
[@lancedb/lancedb](../globals.md) / Job
|
|
|
|
# Class: Job
|
|
|
|
A handle to an operation that may still be running.
|
|
|
|
## Constructors
|
|
|
|
### new Job()
|
|
|
|
```ts
|
|
new Job(): Job
|
|
```
|
|
|
|
#### Returns
|
|
|
|
[`Job`](Job.md)
|
|
|
|
## Accessors
|
|
|
|
### id
|
|
|
|
```ts
|
|
get id(): null | string
|
|
```
|
|
|
|
Identifies the operation on the server that is running it. Operations
|
|
that run in this process have no server id. The value is opaque.
|
|
|
|
#### Returns
|
|
|
|
`null` \| `string`
|
|
|
|
## Methods
|
|
|
|
### cancel()
|
|
|
|
```ts
|
|
cancel(): Promise<void>
|
|
```
|
|
|
|
Request cancellation. Cancelling a finished operation is a no-op.
|
|
|
|
#### Returns
|
|
|
|
`Promise`<`void`>
|
|
|
|
***
|
|
|
|
### status()
|
|
|
|
```ts
|
|
status(): Promise<string>
|
|
```
|
|
|
|
The operation's current lifecycle state: "running", "finished",
|
|
"failed", or "cancelled".
|
|
|
|
A point snapshot; unlike [Job.wait](Job.md#wait) it does not block or reject
|
|
on a terminal failure state. States a newer server reports that this
|
|
client version does not know pass through as-is.
|
|
|
|
#### Returns
|
|
|
|
`Promise`<`string`>
|
|
|
|
***
|
|
|
|
### wait()
|
|
|
|
```ts
|
|
wait(): Promise<void>
|
|
```
|
|
|
|
Wait until the operation reaches a terminal state.
|
|
|
|
#### Returns
|
|
|
|
`Promise`<`void`>
|