
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@omotes/sdk
Advanced tools
This library exposes functionality to publish and consume jobs on the [OMOTES computation engine](https://github.com/Project-OMOTES/computation-engine). Please make sure to follow the steps in that repository to get started running the computation engine
This library exposes functionality to publish and consume jobs on the OMOTES computation engine. Please make sure to follow the steps in that repository to get started running the computation engine locally.
OmotesSDK
Main entry point of this SDK. Requires RabbitMQ port, credentials described above.
const sdk = new OmotesSDK({
rabbitMQUrl: 'localhost',
rabbitMQUsername: 'foo',
rabbitMQPassword: 'bar',
rabbitMQPort: 8088
});
// This is required to setup an AMQP connection.
await sdk.connect();
If you have an ESDL file ready to file with the OMOTES Computation Engine, you can submit a job like so:
const job = await sdk.submitJob('grow_simulator', 'my-esdl');
This will return an instance of the class Job
which can then be used to retrieve different Handler
s (ProgressHandler
, ResultsHandler
, StatusHandler
). These handlers all implement a getter method (getProgress()
, getResult()
, getStatus()
). They return an Observable<T>
with information on the submitted job.
Get a ResultsHandler
like so:
const job = await sdk.submitJob('grow_optimizer', 'esdl');
const resultsHandler = sdk.getResultsHandler(job.uuid);
resultsHandler.getResults().subscribe((result) => {
expect(result).toEqual({
uuid: 'uuid',
logs: 'logs',
outputEsdl: Buffer.from('output_esdl').toString('base64'),
resultType: JobResult.ResultType.SUCCEEDED
});
});
Get a ProgressHandler
like so:
const job = await sdk.submitJob('grow_optimizer', 'esdl');
const progressHandler = sdk.getProgressHandler(job.uuid);
progressHandler.getProgress().subscribe((progress) => {
console.log(progress); // a value between 0 and 1
});
Get a StatusHandler
like so:
const job = sdk.submitJob('grow_optimizer', 'esdl');
const statusHandler = sdk.getStatusHandler(job.uuid);
statusHandler.getStatus().subscribe((status) => {
console.log(status); // one of 'REGISTERED' | 'ENQUEUED' | 'RUNNING' | 'FINISHED' | 'CANCELLED'
});
Run nx build sdk
to build the library.
Run nx test sdk
to execute the unit tests via Jest.
FAQs
This library exposes functionality to publish and consume jobs on the [OMOTES computation engine](https://github.com/Project-OMOTES/computation-engine). Please make sure to follow the steps in that repository to get started running the computation engine
The npm package @omotes/sdk receives a total of 153 weekly downloads. As such, @omotes/sdk popularity was classified as not popular.
We found that @omotes/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.