Add support for jobs & queueables, migrations
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing

- Create migration directives & migrators
- Modify Cache classes to support array manipulation
- Create Redis unit and RedisCache implementation
- Create Queueable base class and Queue class that uses Cache backend
This commit is contained in:
2021-08-23 23:51:53 -05:00
parent 26e0444e40
commit 074a3187eb
28 changed files with 962 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
import {Canonical} from './Canonical'
import {Singleton} from '../di'
import {Maybe} from '../util'
/**
* Error throw when a duplicate canonical key is registered.
@@ -46,6 +47,17 @@ export class Canon {
return this.resources[key] as Canonical<T>
}
/**
* Get a canonical item from a fully-qualified canonical name.
* This is just a quality-of-life wrapper around `this.resource(...).get(...)`.
* @param key
*/
getFromFullyQualified(key: string): Maybe<any> {
const [namespace, ...parts] = key.split('::')
const unqualified = parts.join('::')
return this.resource(namespace).get(unqualified)
}
/**
* Register a canonical resource.
* @param {Canonical} unit