# atdis

> Abstract task dispatching library.

Latest version **0.1.3** (published 2020-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install atdis
pnpm add atdis
yarn add atdis
bun add atdis
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2020-05-21 |
| First published | 2020-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 35.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | eth-p |
| Maintainers | eth-p |

## Links

- npm: https://www.npmjs.com/package/atdis
- Repository: https://github.com/eth-p/node-atdis
- Homepage: https://github.com/eth-p/node-atdis#readme
- Issues: https://github.com/eth-p/node-atdis/issues
- npm.io page: https://npm.io/package/atdis

## Dependencies (2)

- [tsee](https://npm.io/package/tsee.md) ^1.3.0
- [priorityqueue](https://npm.io/package/priorityqueue.md) ^1.0.0

## Recent versions

- 0.1.3 (latest) — 2020-05-21
- 0.1.2 — 2020-05-21
- 0.1.1 — 2020-05-21
- 0.1.0 — 2020-05-20

## README

# atdis
A simple abstract task dispatching library.

## Usage

```typescript
import {Scheduler, Worker} from "atdis";
const scheduler = new Scheduler<string>();
const worker = new Worker(scheduler);
worker.start();

// Tasks are slow async functions.
function download(name: string): Promise<string> {
    return new Promise(resolve => {
        setTimeout(() => resolve(`Hello ${name}!`), 500);
    })
}

// A scheduler uses priority queues to order tasks.
const task = scheduler.schedule(download, {data: 'world'});
const task2 = scheduler.schedule(download, {
    data: 'world',
    retries: 5     // If the task fails, it can be rescheduled transparently.
});

// Tasks can be awaited on.
const data = await task;
```

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