harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
24 lines (23 loc) • 1.18 kB
TypeScript
import * as terms from '../../utility/hdbTerms.ts';
import type { OperationRequest, OperationRequestBody } from '../operationsServer.ts';
import type { Context } from '../../resources/ResourceInterface.ts';
import { OperationFunctionObject } from './OperationFunctionObject.ts';
type ValueOf<T> = T[keyof T];
export type OperationFunctionName = ValueOf<typeof terms.OPERATIONS_ENUM>;
/**
* This will process a command message on this receiving node rather than sending it to a remote node. NOTE: this function
* handles the response to the sender.
*/
export declare function processLocalTransaction(req: OperationRequest, operationFunction: Function): Promise<any>;
export declare function chooseOperation(json: OperationRequestBody): Function;
export declare function getOperationFunction(json: OperationRequestBody): OperationFunctionObject;
/**
* Standalone function to execute an operation
*/
export declare function operation(operation: OperationRequestBody, context: Context, authorize: boolean): Promise<any>;
interface JobResult {
message: string;
job_id: string;
}
export declare function executeJob(json: OperationRequestBody): Promise<JobResult>;
export {};