Skip to main content

LocalAsyncComputeService

Trait LocalAsyncComputeService 

Source
pub trait LocalAsyncComputeService {
    // Required methods
    fn compute(
        &self,
        auth_: BearerToken,
        request: ComputeNodeRequest,
    ) -> impl Future<Output = Result<ComputeNodeResponse, Error>>;
    fn parameterized_compute(
        &self,
        auth_: BearerToken,
        request: ParameterizedComputeNodeRequest,
    ) -> impl Future<Output = Result<ParameterizedComputeNodeResponse, Error>>;
    fn compute_units(
        &self,
        auth_: BearerToken,
        request: ComputeUnitsRequest,
    ) -> impl Future<Output = Result<ComputeUnitResult, Error>>;
    fn batch_compute_with_units(
        &self,
        auth_: BearerToken,
        request: BatchComputeWithUnitsRequest,
    ) -> impl Future<Output = Result<BatchComputeWithUnitsResponse, Error>>;
    fn batch_compute_units(
        &self,
        auth_: BearerToken,
        request: BatchComputeUnitsRequest,
    ) -> impl Future<Output = Result<BatchComputeUnitResult, Error>>;
    fn compute_with_units(
        &self,
        auth_: BearerToken,
        request: ComputeWithUnitsRequest,
    ) -> impl Future<Output = Result<ComputeWithUnitsResponse, Error>>;
    fn batch_kill_requests(
        &self,
        auth_: BearerToken,
        request: BatchKillRequestsRequest,
    ) -> impl Future<Output = Result<(), Error>>;
    fn batch_get_request_progress(
        &self,
        auth_: BearerToken,
        request: BatchGetRequestProgressRequest,
    ) -> impl Future<Output = Result<BatchGetRequestProgressResponse, Error>>;
    fn get_quota_usage(
        &self,
        auth_: BearerToken,
    ) -> impl Future<Output = Result<GetQuotaUsageResponse, Error>>;
}
Expand description

The Compute Service provides the ability to compute the output of compute graphs.

Required Methods§

Source

fn compute( &self, auth_: BearerToken, request: ComputeNodeRequest, ) -> impl Future<Output = Result<ComputeNodeResponse, Error>>

Computes the output of the compute graph specified by a ComputeNodeRequest.

Source

fn parameterized_compute( &self, auth_: BearerToken, request: ParameterizedComputeNodeRequest, ) -> impl Future<Output = Result<ParameterizedComputeNodeResponse, Error>>

Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized compute request supports multiple values for a single variable, supplied by the ParameterizedContext. Results are returned in the same order of the request.

Source

fn compute_units( &self, auth_: BearerToken, request: ComputeUnitsRequest, ) -> impl Future<Output = Result<ComputeUnitResult, Error>>

Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an output of Farads). If the output does not have units (for example, a range output,) the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors are returned.

Source

fn batch_compute_with_units( &self, auth_: BearerToken, request: BatchComputeWithUnitsRequest, ) -> impl Future<Output = Result<BatchComputeWithUnitsResponse, Error>>

Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same order as the request.

Source

fn batch_compute_units( &self, auth_: BearerToken, request: BatchComputeUnitsRequest, ) -> impl Future<Output = Result<BatchComputeUnitResult, Error>>

Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type, meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).

Source

fn compute_with_units( &self, auth_: BearerToken, request: ComputeWithUnitsRequest, ) -> impl Future<Output = Result<ComputeWithUnitsResponse, Error>>

Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an output of Farads). If the output does not have units (for example, a range output,) the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors are returned.

Source

fn batch_kill_requests( &self, auth_: BearerToken, request: BatchKillRequestsRequest, ) -> impl Future<Output = Result<(), Error>>

Best-effort cancellation of active compute requests. Each ID should be the request ID that the client originally passed when starting the request. A single request may correspond to one or more underlying operations, all of which will be cancelled.

Source

fn batch_get_request_progress( &self, auth_: BearerToken, request: BatchGetRequestProgressRequest, ) -> impl Future<Output = Result<BatchGetRequestProgressResponse, Error>>

Returns a point-in-time snapshot of progress for the given active compute requests. Each ID should be the request ID that the client originally passed when starting the request. Intended to be polled (roughly once per second) for requests that have been running longer than the slow-query threshold.

A request with no active queries is not necessarily finished: its underlying queries may not have started yet, the request may be in a post-processing phase, or the request’s work may be executed somewhere that does not report progress — in which case it stays inactive for its entire duration. Clients should derive progress from the raw row counters and must not assume monotonicity, since totalRowsApprox can grow while a request runs.

Source

fn get_quota_usage( &self, auth_: BearerToken, ) -> impl Future<Output = Result<GetQuotaUsageResponse, Error>>

Returns the calling user’s compute quota usage for their current organization, one entry per quota window. Returns no intervals when quotas are not enabled for the organization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§