Skip to content

Commit

Permalink
Migrate to RxJS 5 (#15)
Browse files Browse the repository at this point in the history
* Adjusted package.json to reference correct main file

* Corrected lint command in build

* Bumped build to fix conflicts

* Add .editorconfig file

* Remove dist and typings directories

* Expand ignored files with common entries

* Migrate to rxjs5

* Avoid empty catch block

* Re-indent json files -> 2 spaces

* Update all typings types

* Replace var -> const

* Comply with markdownlint rules

* Add yarn support
  • Loading branch information
nfantone authored and SkippyZA committed Nov 8, 2016
1 parent bc6193e commit abd7869
Show file tree
Hide file tree
Showing 55 changed files with 1,503 additions and 9,021 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
224 changes: 221 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,222 @@
build/
node_modules/
### Typescript ###
dist/

npm-debug.log
### Typings ###
## Ignore downloaded typings
typings

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### Eclipse ###
*.pydevproject
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans


### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties


### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
*.sublime-project

# sftp configuration file
sftp-config.json


### TextMate ###
*.tmproj
*.tmproject
tmtags


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# RxJS wrapper for amqplib

rx-amqplib is a wrapper for using the squaremo amqplib NodeJS package with RxJS.

## Gettings started

To include this library in your project, all you need to do is install it using NPM.

```
$ npm install rx-amqplib --save
```sh
npm install rx-amqplib --save
```

## Examples

Here is a basic example of creating a connection to a RabbitMQ server, creating a channel + queue and sneding a message to the queue.

```javascript
```js
const config = {
queue: 'test_queue',
host: 'amqp://localhost'
Expand All @@ -24,7 +25,7 @@ RxAmqpLib.newConnection(config.host)
.flatMap(connection => connection
.createChannel()
.flatMap(channel => channel.assertQueue(config.queue, { durable: false }))
.doOnNext(reply => reply.channel.sendToQueue(config.queue, new Buffer('Test message')))
.do(reply => reply.channel.sendToQueue(config.queue, new Buffer('Test message')))
.flatMap(reply => reply.channel.close())
.flatMap(() => connection.close())
)
Expand All @@ -33,62 +34,61 @@ RxAmqpLib.newConnection(config.host)

## More Examples

1. ### Hello World
* ### Hello World

[Server](./examples/server.js), [Client](./examples/client.js)

The simplest thing that does something.

![](https://www.rabbitmq.com/img/tutorials/python-one.png "Hello world queue")

2. ### Work Queues
* ### Work Queues

[New task](./examples/new_task.js), [Worker](./examples/worker.js)

Distributing tasks among workers

![](https://www.rabbitmq.com/img/tutorials/python-two.png "Worker queue")

3. ### Publish/Subscribe
* ### Publish/Subscribe

[Emit logs](./examples/emit_logs.js), [Receive logs](./examples/receive_logs.js)

Sending messages to many consumers at once

![](https://www.rabbitmq.com/img/tutorials/python-three.png "Publish/Subscribe Queue")

4. ### Routing
* ### Routing

[Emit log](./examples/emit_log_direct.js), [Receive logs](./examples/receive_logs_direct.js)

Receiving messages selectively

![](https://www.rabbitmq.com/img/tutorials/python-four.png "Routing Queue")

5. ### Topics
* ### Topics

[Emit log](./examples/emit_log_topic.js), [Receive logs](./examples/receive_logs_topic.js)

Receiving messages based on a pattern

![](https://www.rabbitmq.com/img/tutorials/python-five.png "Topic Queue")

6. ### RPC
* ### RPC

[RPC Server](./examples/rpc_server.js), [RPC Client](./examples/rpc_client.js)

Remote procedure call implementation

![](https://www.rabbitmq.com/img/tutorials/python-six.png "RPC Queue")


## Build it Yourself

Should you wish to build the library yourself, either for personal use, or for contribution, please ensure there are no errors emitted during the build process with `npm run build`.
Should you wish to build the library yourself, either for personal use or for contribution, please ensure there are no errors emitted during the build process with `npm run build`.

```
$ git clone [email protected]:SkippyZA/rx-amqplib.git
$ cd rx-amqplib
$ npm install
$ npm run build
```sh
git clone [email protected]:SkippyZA/rx-amqplib.git
cd rx-amqplib
npm install
npm run build
```
17 changes: 0 additions & 17 deletions dist/RxAmqpLib.d.ts

This file was deleted.

Loading

0 comments on commit abd7869

Please sign in to comment.