Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Aug 2, 2019
2 parents 0eb670f + 9cb1832 commit 5a8eece
Show file tree
Hide file tree
Showing 21 changed files with 2,115 additions and 2,776 deletions.
12 changes: 7 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:lts
- image: circleci/node:latest
environment:
- NODE_ENV: test

Expand All @@ -18,9 +18,7 @@ jobs:

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v1.0.3-dependencies-{{ checksum "package.json" }}

- run:
name: Install global packages
Expand All @@ -35,7 +33,7 @@ jobs:
command: npm install

- save_cache:
key: v1-dependencies-{{ checksum "package.json" }}
key: v1.0.3-dependencies-{{ checksum "package.json" }}
paths:
- node_modules

Expand All @@ -51,6 +49,10 @@ jobs:
name: Integration Tests
command: npm run test:integration

- run:
name: Mutation Tests
command: npm run test:mutants

- run:
name: Push any lockfile changes
command: greenkeeper-lockfile-upload
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['standard', 'prettier', 'prettier/standard'],
plugins: ['prettier', 'standard', 'mocha'],
plugins: ['prettier', 'standard', 'import', 'promise'],
parserOptions: {
sourceType: 'module'
},
Expand Down
53 changes: 26 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# amqp-delegate

A very simple, performant, remote worker system that uses `AMQP` to coordinate jobs.

[![Greenkeeper badge](https://badges.greenkeeper.io/davesag/amqp-delegate.svg)](https://greenkeeper.io/)

<!-- prettier-ignore -->
| branch | status | coverage | notes |
| ------ | ------ | -------- | ----- |
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/amqp-delegate/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/amqp-delegate/tree/develop) | [![codecov](https://codecov.io/gh/davesag/amqp-delegate/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-delegate) | Work in progress |
| `master` | [![CircleCI](https://circleci.com/gh/davesag/amqp-delegate/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/amqp-delegate/tree/master) | [![codecov](https://codecov.io/gh/davesag/amqp-delegate/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-delegate) | Latest stable release |
A remote worker system that uses `AMQP` to coordinate jobs.

[![NPM](https://nodei.co/npm/amqp-delegate.png)](https://nodei.co/npm/amqp-delegate/)

## See Also

- [`amqp-simple-pub-sub`](https://github.com/davesag/amqp-simple-pub-sub) — A library that simplifies use of aqmp based publishers and subscribers.
- [`amqp-simple-pub-sub`](https://github.com/davesag/amqp-simple-pub-sub) — A library that simplifies use of `AMQP` based publishers and subscribers.

## Usage

```
```sh
npm install amqp-delegate
```

## Worker

```
```js
const { makeWorker } = require('amqp-delegate')

const worker = makeWorker({
Expand Down Expand Up @@ -52,7 +44,7 @@ worker.stop().then(() => {

## Delegator

```
```js
const { makeDelegator } = require('amqp-delegate')

const delegator = makeWorker({
Expand Down Expand Up @@ -80,7 +72,7 @@ delegator

### The worker

```
```js
const { makeWorker } = require('amqp-delegate')

const task = (a, b) =>
Expand All @@ -95,11 +87,9 @@ worker
.start()
.then(() => {
process.on('SIGINT', () => {
worker
.stop()
.then(() => {
process.exit(0)
})
worker.stop().then(() => {
process.exit(0)
})
})
})
.catch(err => {
Expand All @@ -109,7 +99,7 @@ worker

### The delegator

```
```js
const { makeDelegator } = require('amqp-delegate')

const delegator = makeDelegator()
Expand All @@ -127,34 +117,43 @@ delegator

## Development

[![Greenkeeper badge](https://badges.greenkeeper.io/davesag/amqp-delegate.svg)](https://greenkeeper.io/)

<!-- prettier-ignore -->
| branch | status | coverage | notes |
| ------ | ------ | -------- | ----- |
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/amqp-delegate/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/amqp-delegate/tree/develop) | [![codecov](https://codecov.io/gh/davesag/amqp-delegate/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-delegate) | Work in progress |
| `master` | [![CircleCI](https://circleci.com/gh/davesag/amqp-delegate/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/amqp-delegate/tree/master) | [![codecov](https://codecov.io/gh/davesag/amqp-delegate/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-delegate) | Latest stable release |

### Prerequisites

- [NodeJS](htps://nodejs.org), version 10.15.3 or better (I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.)
- [NodeJS](htps://nodejs.org), version 8.10.0 or better (I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.)
- [Docker](https://www.docker.com) (Use [Docker for Mac](https://docs.docker.com/docker-for-mac/), not the homebrew version)

### Initialisation

```
```sh
npm install
```

### To Start the queue server for integration testing.

```
```sh
docker-compose up -d
```

Runs Rabbit MQ.

### Test it

- `npm test` — runs the unit tests (does not need rabbitmq)
- `npm run test:unit:cov` — runs the unit tests with code coverage (does not need rabbitmq)
- `npm run test:integration` — runs the integration tests (needs rabbitmq)
- `npm test` — runs the unit tests (does not need `rabbitmq`)
- `npm run test:unit:cov` — runs the unit tests with code coverage (does not need `rabbitmq`)
- `npm run test:integration` — runs the integration tests (needs `rabbitmq`)
- `npm run test:mutants` — runs the mutation tests (does not need `rabbitmq`)

### Lint it

```
```sh
npm run lint
```

Expand Down
60 changes: 0 additions & 60 deletions config.yml

This file was deleted.

Loading

0 comments on commit 5a8eece

Please sign in to comment.