Permalink
Browse files

Merge branch 'release/1.0.2'

  • Loading branch information...
FGRibreau committed Jan 28, 2013
2 parents c713ce8 + 6e39926 commit 4ba47a26acffb83d820fdd6569d57701de9a54f9
Showing with 161 additions and 427 deletions.
  1. +1 −1 .gitignore
  2. +22 −0 LICENCE-MIT.txt
  3. +14 −6 README.md
  4. 0 grunt.js
  5. +2 −0 index.js
  6. +0 −194 lib/AmqpDsl.js
  7. +0 −24 lib/AmqpExchange.js
  8. +0 −38 lib/AmqpQueue.js
  9. +0 −41 lib/IndexedList.js
  10. +28 −27 package.json
  11. +38 −35 src/AmqpDsl.coffee
  12. +13 −8 src/AmqpQueue.coffee
  13. +43 −53 test/AmqpDsl-test.coffee
View
@@ -5,4 +5,4 @@ node_modules
*.log
# mac
-DS_STORE
+.DS_Store
View
@@ -0,0 +1,22 @@
+Copyright (c) 2013 FG Ribreau
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
@@ -25,9 +25,9 @@ amqp.login(
if err
throw err
return
-
+
console.log 'We are connected !'
-
+
)
```
@@ -47,6 +47,7 @@ AmqpDsl.login(
.queue( 'testQueue', (queue) -> console.log "Connected to Queue", queue.name )
.bind( 'stream', '#' )
+ .bind( 'stream2', 'routing.key' )
.subscribe( (message, header, deliveryInfo) -> )
.queue( 'queue2' )
@@ -63,7 +64,7 @@ AmqpDsl.login(
# Do other stuff with `amqp` like subscribing to a queue
queue3 = amqp.queues.queue3
-
+
queue3.subscribe( ack:true, ( message, header, deliveryInfo ) ->
console.log "Hey ! We got one new message !"
queue3.shift()
@@ -102,7 +103,7 @@ See `examples/` and `docs/` for more information.
### .connect
* `.connect( amqp, callback(err, amqp) )`
* `.connect( callback(err, amqp) )`
-
+
The `amqp` argument is simply hashtable with the following properties:
* queues (hashtable of `AMQP::queues`)
@@ -118,5 +119,12 @@ The `amqp` argument is simply hashtable with the following properties:
... and browse `docs/`
## Test
-
- $ npm test
+
+ $ npm test
+
+## Release History
+v1.0.1 - .bind & .subscribe can now be called multiple times. This is the behavior that should have been in place since the beginning.
+
+## License
+Copyright (c) 2013 Francois-Guillaume Ribreau
+Licensed under the MIT license.
View
No changes.
View
@@ -0,0 +1,2 @@
+require('coffee-script');
+module.exports = require('./src/AmqpDsl');
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,24 +0,0 @@
-(function() {
- var AmqpExchange;
-
- module.exports = AmqpExchange = (function() {
-
- function AmqpExchange(name, options, openCallback) {
- this.name = name;
- if (!this.name) throw new Error("Exchange must have a name");
- this.options = {};
- this.openCallback = function() {};
- if (typeof options === "function") {
- this.openCallback = options;
- } else if (typeof options === "object") {
- this.options = options;
- }
- if (typeof openCallback === "function") this.openCallback = openCallback;
- this.ref = null;
- }
-
- return AmqpExchange;
-
- })();
-
-}).call(this);
View
@@ -1,38 +0,0 @@
-(function() {
- var AmqpQueue;
-
- module.exports = AmqpQueue = (function() {
-
- function AmqpQueue(name, options, openCallback) {
- this.name = name;
- if (!this.name) throw new Error("Queue must have a name");
- this.options = {};
- this.openCallback = function() {};
- if (typeof options === "function") {
- this.openCallback = options;
- } else if (typeof options === "object") {
- this.options = options;
- }
- if (typeof openCallback === "function") this.openCallback = openCallback;
- this.ref = null;
- }
-
- AmqpQueue.prototype.bind = function(exchangeName, routingKey) {
- this.exchangeName = exchangeName;
- this.routingKey = routingKey;
- };
-
- AmqpQueue.prototype.subscribe = function(sOptions, messageListener) {
- this.sOptions = sOptions;
- this.messageListener = messageListener;
- if (typeof this.sOptions === 'function') {
- this.messageListener = this.sOptions;
- return this.sOptions = {};
- }
- };
-
- return AmqpQueue;
-
- })();
-
-}).call(this);
View
@@ -1,41 +0,0 @@
-(function() {
- var IndexedList;
-
- module.exports = IndexedList = (function() {
-
- function IndexedList() {
- this._index = {};
- this._list = [];
- }
-
- IndexedList.prototype.get = function(key) {
- return this._index[key] || false;
- };
-
- IndexedList.prototype.set = function(key, value) {
- this._list.push(value);
- this._index[key] = value;
- return null;
- };
-
- IndexedList.prototype.length = function() {
- return this._list.length;
- };
-
- IndexedList.prototype.last = function() {
- return this._list[this._list.length - 1] || false;
- };
-
- IndexedList.prototype.index = function() {
- return this._index;
- };
-
- IndexedList.prototype.list = function() {
- return this._list;
- };
-
- return IndexedList;
-
- })();
-
-}).call(this);
Oops, something went wrong.

0 comments on commit 4ba47a2

Please sign in to comment.