<commit_before># RabRPC
[![Build Status](https://travis-ci.org/swarthy/rabrpc.svg?branch=master)](https://travis-ci.org/swarthy/rabrpc)
[![Dependencies Status](https://david-dm.org/swarthy/rabrpc.svg)]()

Another RPC library based on [RabbitMQ](http://www.rabbitmq.com/) (through [rabbot](https://github.com/arobson/rabbot))

> WARNING: This project is currently in its BETA stage!

## Features

 * Promise-based interface (thanks [rabbot](https://github.com/arobson/rabbot))
 * Convention over configuration in exchange, queue, routingKeys naming

The only listed below producer/consumer patterns are implemented now:
* [X] Request / Response
* [] Publish / Subscribe
* [] Send / Receive

## Installation
```bash
npm install --save rabrpc
```

## Examples

### Request / Response

#### Initialization

> Important! `rpc.initialize` *should* be called **after** binding handlers via `rpc.respond` in consumer microservice and *must* be called **before** requesting data with `rpc.request` in provider microservice


##### Responder initialization

```javascript
const rpc = require('rabrpc') // singleton<commit_msg>readme fix<commit_after># RabRPC
[![Build Status](https://travis-ci.org/swarthy/rabrpc.svg?branch=master)](https://travis-ci.org/swarthy/rabrpc)
[![Dependencies Status](https://david-dm.org/swarthy/rabrpc.svg)]()

Another RPC library based on [RabbitMQ](http://www.rabbitmq.com/) (through [rabbot](https://github.com/arobson/rabbot))

> WARNING: This project is currently in its BETA stage!

## Features

 * Promise-based interface (thanks [rabbot](https://github.com/arobson/rabbot))
 * Convention over configuration in exchange, queue, routingKeys naming

The only listed below producer/consumer patterns are implemented now:
* [x] Request / Response
* [ ] Publish / Subscribe
* [ ] Send / Receive

## Installation
```bash
npm install --save rabrpc
```

## Examples

### Request / Response

#### Initialization

> Important! `rpc.initialize` *should* be called **after** binding handlers via `rpc.respond` in consumer microservice and *must* be called **before** requesting data with `rpc.request` in provider microservice


##### Responder initialization

```javascript
const rpc = require('rabrpc') // singleton
{'fraction_non_alphanumeric': 0.14612281488121917, 'fraction_numerical': 0.0, 'mean_word_length': 5.2, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1806845', 'n_tokens_mistral': 693, 'n_tokens_neox': 652, 'n_words': 188}