@superlogica/super-hydra-client-js
v1.0.0
Published
Client JS para produção de jobs da Hydra da Superlógica
Downloads
8
Readme
What is Super Hydra Client?
Client JS for producing Superlógica Hydra jobs. Jobs are produced in redis and consumed by the Hydra application, which triggers HTTP requests as configured in the jobs.
Getting started
To install the lib just run the command:
npm install @superlogica/super-hydra-client-js
Ready!
Now you can use the available interfaces and the adapter.
How it works?
The most basic possible use is to import default (adapter) and use it, as in the following example:
import Hydra, RedisClient, JobOptions from '@superlogica/super-hydra-client-js';
async function createJob() {
const transport = new RedisClient('redis://localhost', '6379')
const hydra = new Hydra(
'my-topic',
'my-group',
transport,
new JobOptions()
)
await hydra.sync('123', {test: 123}, HttpMethod.POST, 'http://localhost')
}