-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(query-orchestrator): Introduce CubeStoreCacheDriver
- Loading branch information
Showing
25 changed files
with
242 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './BaseDriver'; | ||
export * from './utils'; | ||
export * from './driver.interface'; | ||
export * from './queue-driver.interface'; | ||
export * from './cache-driver.interface'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export interface LocalQueueDriverConnectionInterface { | ||
getResultBlocking(queryKey: string): Promise<unknown>; | ||
getResult(queryKey: string): Promise<unknown>; | ||
addToQueue(queryKey: string): Promise<unknown>; | ||
getToProcessQueries(): Promise<unknown>; | ||
getActiveQueries(): Promise<unknown>; | ||
getOrphanedQueries(): Promise<unknown>; | ||
getStalledQueries(): Promise<unknown>; | ||
getQueryStageState(onlyKeys: any): Promise<unknown>; | ||
updateHeartBeat(queryKey: string): Promise<void>; | ||
getNextProcessingId(): Promise<string>; | ||
retrieveForProcessing(queryKey: string, processingId: string): Promise<unknown>; | ||
freeProcessingLock(queryKe: string, processingId: string, activated: unknown): Promise<unknown>; | ||
optimisticQueryUpdate(queryKey, toUpdate, processingId): Promise<unknown>; | ||
cancelQuery(queryKey: string): Promise<unknown>; | ||
setResultAndRemoveQuery(queryKey: string, executionResult: any, processingId: any): Promise<unknown>; | ||
release(): Promise<void>; | ||
} | ||
|
||
export interface QueueDriverInterface { | ||
createConnection(): Promise<LocalQueueDriverConnectionInterface>; | ||
release(connection: LocalQueueDriverConnectionInterface): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
const fromExports = require('./dist/src'); | ||
const { CubeStoreDriver } = require('./dist/src/CubeStoreDriver'); | ||
const { CubeStoreDevDriver } = require('./dist/src/CubeStoreDevDriver'); | ||
const { isCubeStoreSupported, CubeStoreHandler } = require('./dist/src/rexport'); | ||
|
||
/** | ||
* After 5 years working with TypeScript, now I know | ||
* that commonjs and nodejs require is not compatibility with using export default | ||
*/ | ||
module.exports = CubeStoreDriver; | ||
const toExport = CubeStoreDriver; | ||
|
||
/** | ||
* It's needed to move our CLI to destructing style on import | ||
* Please sync this file with src/index.ts | ||
*/ | ||
module.exports.CubeStoreDevDriver = CubeStoreDevDriver; | ||
module.exports.isCubeStoreSupported = isCubeStoreSupported; | ||
module.exports.CubeStoreHandler = CubeStoreHandler; | ||
// eslint-disable-next-line no-restricted-syntax | ||
for (const [key, module] of Object.entries(fromExports)) { | ||
toExport[key] = module; | ||
} | ||
|
||
module.exports = toExport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.