# recurry

> recurring REST call scheduler (instead of cron+flock)

Latest version **0.0.27** (published 2016-09-10) · GPL3 license · 0 weekly downloads

## Install

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

Provides the command `recurry`.

## 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.0.27 |
| Published | 2016-09-10 |
| First published | 2015-06-12 |
| Weekly downloads | 0 |
| License | GPL3 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+3 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leon van Kammen / Coder of Salvation |
| Maintainers | coderofsalvation |
| Keywords | cron, rest, scheduler, recurring, hubot, payload, api |

## Links

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

## Dependencies (9)

- [JSV](https://npm.io/package/JSV.md) ^4.0.2
- [request](https://npm.io/package/request.md) ^2.57.0
- [restify](https://npm.io/package/restify.md) ^3.0.3
- [english-time](https://npm.io/package/english-time.md) 0.0.9
- [coffeerest-api](https://npm.io/package/coffeerest-api.md) ^0.1.28
- [flat-file-cache](https://npm.io/package/flat-file-cache.md) 0.0.1
- [setinterval-plus](https://npm.io/package/setinterval-plus.md) ^1.0.2
- [coffeerest-api-doc](https://npm.io/package/coffeerest-api-doc.md) ^0.1.46
- [json-schema-defaults](https://npm.io/package/json-schema-defaults.md) ^0.1.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.27 (latest) — 2016-09-10
- 0.0.26 — 2016-09-09
- 0.0.25 — 2016-09-09
- 0.0.24 — 2016-09-09
- 0.0.23 — 2016-09-09
- 0.0.22 — 2016-07-22
- 0.0.21 — 2016-03-07
- 0.0.20 — 2015-09-30
- 0.0.19 — 2015-08-29
- 0.0.18 — 2015-06-14
- 0.0.17 — 2015-06-13
- 0.0.16 — 2015-06-12
- 0.0.15 — 2015-06-12
- 0.0.14 — 2015-06-12
- 0.0.133 — 2015-06-12
- … 4 more at https://npm.io/package/recurry/versions

## README

# Recurry 

recurrent REST call scheduler 

> Note: for delayed jobs please use a queue like kue 

These days almost anything can be triggered using REST calls, so meet Recurry.
Recurry does recurring REST calls, with a nice degree of (remote) control.

You can think of recurry as cron+flock on a unix platform, except without the files (but a REST interface).

# Usage 

    $ npm install recurry coffee-script
    $ echo '{"cache":{"scheduler":[],"timers":[]}}' > cache.json
    $ RECURRY_CACHEFILE="cache.json" ./server

> NOTE: Recurry supports persistance, but does not require a database (instead it uses a local jsonfile)

# Hubot interface 

Instead of fiddling with crontab-files, the `recurry-hubot` module allows hubot interfacing with the REST api: 

* starting, stopping, pausing, resuming recurring REST calls
* adding and removing REST calls including payload

Make sure you run `npm install recurry-hubot` in your hubot rootdir, and get in control:

    hubot> recurry

    id           method  url                          payload  scheduler  triggered  triggered_last            status   timer
    -----------  ------  ---------------------------  -------  ---------  ---------  ------------------------  -------  -----
    ping         post    http://foo.com/ping          {}       1 minutes  1235       2015-06-12T13:35:49.173Z  start'd  {}   
    pushjob      post    http://queue.foo.com/ping    {}       5 minutes  54         2015-06-12T13:35:49.173Z  start'd  {}   
    flapjob      post    http://queue.foo.com/flap    {}       5 minutes  54         2015-06-12T13:35:49.173Z  start'd  {}   
    ...

# JSON API

Documentation of API endpoints

### GET /scheduler/remove/:id

stops and removes a scheduler

### PUT /scheduler/trigger/:id

manually triggers a scheduler id

### PUT /scheduler/action/:id

starts/stops/pauses/resumes a scheduler

Example payload:

     {
       "action": "pause"
     }

JSON Schema:

     {
       "type": "object",
       "properties": {
         "action": {
           "id": "http://recurry/scheduler/action",
           "type": "string",
           "required": true,
           "default": "pause",
           "enum": [
             "start",
             "stop",
             "pause",
             "resume",
             "trigger"
           ]
         }
       }
     }

### PUT /scheduler/rule/:id

sets the scheduler

Example payload:

     {
       "scheduler": "5 minutes"
     }

JSON Schema:

     {
       "type": "object",
       "properties": {
         "scheduler": {
           "id": "http://recurry/scheduler",
           "type": "string",
           "required": true,
           "default": "5 minutes"
         }
       }
     }

### GET /scheduler

returns complete content of scheduled jobs

### POST /scheduler

allows posting of a job scheduler

Example payload:

     {
       "method": "post",
       "id": "call foo",
       "url": "http://foo.com/ping",
       "payload": {},
       "scheduler": "5 minutes"
     }

JSON Schema:

     {
       "type": "object",
       "properties": {
         "method": {
           "id": "http://recurry/method",
           "type": "string",
           "required": true,
           "enum": [
             "get",
             "post",
             "put",
             "delete",
             "options"
           ],
           "default": "post"
         },
         "id": {
           "id": "http://recurry/id",
           "type": "string",
           "default": "call foo"
         },
         "url": {
           "id": "http://recurry/url",
           "type": "string",
           "required": true,
           "default": "http://foo.com/ping"
         },
         "payload": {
           "id": "http://recurry/payload",
           "type": "object"
         },
         "scheduler": {
           "id": "http://recurry/scheduler",
           "type": "string",
           "default": "5 minutes"
         }
       }
     }

### GET /scheduler/:id

get a scheduler object including payload 

### GET /scheduler/reset/:id

resets the 'triggered' counter of a scheduled job

### PUT /payload/:id

updates (optional) specific arguments which will be passed to the job

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