# @enviabybus/active-job-processor

> Interface for async tasks in node

Latest version **0.0.1** (published 2021-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @enviabybus/active-job-processor
pnpm add @enviabybus/active-job-processor
yarn add @enviabybus/active-job-processor
bun add @enviabybus/active-job-processor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-02-08 |
| First published | 2021-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Enviabybus |
| Maintainers | marcelo.pelos.enviabybus |

## Links

- npm: https://www.npmjs.com/package/@enviabybus/active-job-processor
- Repository: https://github.com/Enviabybus/node-active-job-processor
- Homepage: https://github.com/Enviabybus/node-active-job-processor#readme
- Issues: https://github.com/Enviabybus/node-active-job-processor/issues
- npm.io page: https://npm.io/package/@enviabybus/active-job-processor

## Recent versions

- 0.0.1 (latest) — 2021-02-08

## README

# ActiveJobProcessor

Interface for adapters to work with async jobs on node.

## Install

```
npm install @enviabybus/active-job-processor
```

## Adapters

[Bull Adapter](https://github.com/Enviabybus/node-active-job-processor-bull-adapter)

[Google Cloud Tasks Adapter](https://github.com/Enviabybus/node-active-job-processor-cloud-tasks-adapter)

## Creating a job

```ts
// src/jobs/ping.job.ts

class PingJob {
  static perform(message: string): void {
    console.log(message);
  }
}

export default PingJob;
```

## How to use

```ts
// src/index.ts

import ActiveJobProcessor, { initActiveJobProcessor } from '@enviabybus/active-job-processor';
import ActiveJobProcessorBullAdapter from '@enviabybus/active-job-processor-bull-adapter';

import PingJob from './jobs/ping.job.ts'

initActiveJobProcessor(path.resolve(__dirname, './jobs'));

const adapter = new ActiveJobProcessorBullAdapter();
const jobProcessor = new ActiveJobProcessor(adapter);

jobProcessor.performLater(PingJob, ['pong']);
jobProcessor.performIn(5000, PingJob, ['pong']);
jobProcessor.performAt(new Date(), PingJob, ['pong']);
```

---
_Source: https://npm.io/package/@enviabybus/active-job-processor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
