1.0.0 • Published 6 months ago

@superlogica/super-hydra-client-js v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Super Hydra Client JS

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')
}