Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'release/0.1.0' into develop

  • Loading branch information...
commit 4738f54d9cdf4b3fad748670f03dbd6491fd9686 2 parents f4d8e49 + d58d1ec
Francois-Guillaume Ribreau authored

Showing 1 changed file with 44 additions and 43 deletions. Show diff stats Hide diff stats

  1. 87  README.md
87  README.md
Source Rendered
@@ -12,64 +12,64 @@ AMQP-DSL is a [fluent interface](http://en.wikipedia.org/wiki/Fluent_interface)
12 12
 
13 13
 ```coffeescript
14 14
 
15  
-    amqp = require 'amqp-dsl'
  15
+amqp = require 'amqp-dsl'
16 16
 
17  
-    amqp.login(
  17
+amqp.login(
18 18
 
19  
-      login: 'user'
20  
-      password: 'password'
21  
-      host: 'localhost'
  19
+  login: 'user'
  20
+  password: 'password'
  21
+  host: 'localhost'
22 22
 
23  
-    ).connect((err, amqp) ->
  23
+).connect((err, amqp) ->
24 24
 
25  
-      if err
26  
-        throw err
27  
-        return
28  
-      
29  
-      console.log 'We are connected !'
30  
-      
31  
-    )
  25
+  if err
  26
+    throw err
  27
+    return
  28
+  
  29
+  console.log 'We are connected !'
  30
+  
  31
+)
32 32
 ```
33 33
 
34 34
 ### Simple example (more details: `docs/example-simple`)
35 35
 
36 36
 ```coffeescript
37 37
 
38  
-    AmqpDsl = require 'amqp-dsl'
  38
+AmqpDsl = require 'amqp-dsl'
39 39
 
40  
-    AmqpDsl.login(
41  
-      login: 'legen'
42  
-      password: 'dary'
43  
-    )
44  
-    .on( 'close', () -> console.error "RabbitMQ connection closed" )
45  
-    .on( 'error', (err) -> console.error "RabbitMQ error", err )
46  
-    .on( 'ready', () -> console.log "Connected to RabbitMQ" )
  40
+AmqpDsl.login(
  41
+  login: 'legen'
  42
+  password: 'dary'
  43
+)
  44
+.on( 'close', () -> console.error "RabbitMQ connection closed" )
  45
+.on( 'error', (err) -> console.error "RabbitMQ error", err )
  46
+.on( 'ready', () -> console.log "Connected to RabbitMQ" )
47 47
 
48  
-    .queue( 'testQueue', (queue) -> console.log "Connected to Queue", queue.name )
49  
-      .bind( 'stream', '#' )
50  
-      .subscribe( (message, header, deliveryInfo) -> )
  48
+.queue( 'testQueue', (queue) -> console.log "Connected to Queue", queue.name )
  49
+  .bind( 'stream', '#' )
  50
+  .subscribe( (message, header, deliveryInfo) -> )
51 51
 
52  
-    .queue( 'queue2' )
53  
-      .bind( 'search', '#.ok' )
  52
+.queue( 'queue2' )
  53
+  .bind( 'search', '#.ok' )
54 54
 
55  
-    .queue( 'queue3', passive:true )
  55
+.queue( 'queue3', passive:true )
56 56
 
57  
-    .connect( (err, amqp) ->
  57
+.connect( (err, amqp) ->
58 58
 
59  
-      if err
60  
-        throw err
61  
-        return
  59
+  if err
  60
+    throw err
  61
+    return
62 62
 
63  
-      # Do other stuff with `amqp` like subscribing to a queue
  63
+  # Do other stuff with `amqp` like subscribing to a queue
64 64
 
65  
-      queue3 = amqp.queues.queue3
66  
-      
67  
-      queue3.subscribe( ack:true, ( message, header, deliveryInfo ) ->
68  
-        console.log "Hey ! We got one new message !"
69  
-        queue3.shift()
70  
-      )
  65
+  queue3 = amqp.queues.queue3
  66
+  
  67
+  queue3.subscribe( ack:true, ( message, header, deliveryInfo ) ->
  68
+    console.log "Hey ! We got one new message !"
  69
+    queue3.shift()
  70
+  )
71 71
 
72  
-    )
  72
+)
73 73
 ```
74 74
 
75 75
 See `examples/` and `docs/` for more information.
@@ -103,10 +103,11 @@ See `examples/` and `docs/` for more information.
103 103
  * `.connect( amqp, callback(err, amqp) )`
104 104
  * `.connect( callback(err, amqp) )`
105 105
  
106  
- `amqp` contains
107  
-      * queues (hashtable of `AMQP::queues`)
108  
-      * exchanges (hashtable of `AMQP::Exchange`)
109  
-      * connection (`AMQP::Connection`)
  106
+The `amqp` argument is simply hashtable with the following properties:
  107
+
  108
+ * queues (hashtable of `AMQP::queues`)
  109
+ * exchanges (hashtable of `AMQP::Exchange`)
  110
+ * connection (`AMQP::Connection`)
110 111
 
111 112
 
112 113
 ## Documentation

0 notes on commit 4738f54

Please sign in to comment.
Something went wrong with that request. Please try again.