# task-attemptor

> ## What it does:

Latest version **0.2.0** (published 2019-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install task-attemptor
pnpm add task-attemptor
yarn add task-attemptor
bun add task-attemptor
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-02-20 |
| First published | 2019-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 26.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | c19 |
| Keywords | BuckleScript |

## Links

- npm: https://www.npmjs.com/package/task-attemptor
- npm.io page: https://npm.io/package/task-attemptor

## Dependencies (11)

- [bs-knex](https://npm.io/package/bs-knex.md) ^3.1.0
- [bs-moment](https://npm.io/package/bs-moment.md) ^0.4.2
- [@glennsl/bs-json](https://npm.io/package/@glennsl/bs-json.md) ^3.0.0
- [@lab-79/bs-knex2](https://npm.io/package/@lab-79/bs-knex2.md) 0.2.1
- [@lab-79/bs-twilio](https://npm.io/package/@lab-79/bs-twilio.md) ^0.3.2
- [@lab-79/bs-sp-call](https://npm.io/package/@lab-79/bs-sp-call.md) 0.3.0
- [@lab-79/bs-sp-chatbot](https://npm.io/package/@lab-79/bs-sp-chatbot.md) 1.2.0
- [@lab-79/bs-knex2-config](https://npm.io/package/@lab-79/bs-knex2-config.md) ^0.1.1
- [@lab-79/smart-practice-tasks](https://npm.io/package/@lab-79/smart-practice-tasks.md) ^1.0.4
- [@lab-79/bs-smart-practice-models](https://npm.io/package/@lab-79/bs-smart-practice-models.md) 1.2.0
- [@lab-79/bs-request-promise-native](https://npm.io/package/@lab-79/bs-request-promise-native.md) ^0.1.0

## Recent versions

- 0.2.0 (latest) — 2019-02-20

## README

# Task Attemptor

## What it does:

1. Query all dispatched, un-attempted(currently) tasks that is expected to be attempted before `now()` *(usually assigned by task dispatcher)*
2. Check the task:
    1. **If the task is outdated**: revert the task state into un-dispatched.
    2. **Otherwise**: fetch the channel configurations of rate limiting for the expected attempt channel of the task

3. Generate task attempt:
    1. On rate limiting unexceeded, create a new instance of `task_attempt`, mark the task as `procing`

4. Check if the task is valid for attempting

5. If task valid for attempting, attempt the task via given task type and task channel

## How it runs:

### Configuration:

1. One instance per `TaskType × Channel`
2. Envs vars:
   - `APPOINTMENT_SUGGESTION_SERVICE_URL`: the appointment suggestion service url, without protocol header

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