Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 6cb113c

Browse files
committed
Update docs, add index. Add note about possible multiple queues subscriptions
1 parent cdfa0e4 commit 6cb113c

File tree

7 files changed

+75
-5
lines changed

7 files changed

+75
-5
lines changed

docs/frame.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html> <html> <head> <title>frame.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> frame.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h2>frame</h2>
1+
<!DOCTYPE html> <html> <head> <title>frame.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="index.html"> index.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> frame.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h2>frame</h2>
22

33
<p>The <code>Frame</code> module provides an object representation of a <code>Stomp</code> frame.</p>
44

docs/index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html> <html> <head> <title>index.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="index.html"> index.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h1>stomp-js</h1>
2+
3+
<h2>Overview</h2>
4+
5+
<p>An exercise with node.js to implement the STOMP protocol.</p>
6+
7+
<p>For documentation see doc/stomp.md and doc/frame.md</p>
8+
9+
<h2>Installation</h2>
10+
11+
<p><code>npm install stomp</code></p>
12+
13+
<p><code>git clone https://benjaminws@github.com/benjaminws/stomp-js.git</code></p>
14+
15+
<h2>Examples</h2>
16+
17+
<h3>Consumer</h3>
18+
19+
<p>See examples/stomp-consumer.js</p>
20+
21+
<h3>Producer</h3>
22+
23+
<p>See examples/stomp-producer.js</p>
24+
25+
<h3>Producer with Transaction Support</h3>
26+
27+
<p>See examples/stomp-producer-txn.js</p> </td> <td class="code"> <div class="highlight"><pre>
28+
29+
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>

docs/stomp-exceptions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html> <html> <head> <title>stomp-exceptions.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp-exceptions.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">QueueEmpty</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">QueueEmpty</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
1+
<!DOCTYPE html> <html> <head> <title>stomp-exceptions.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="index.html"> index.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp-exceptions.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">QueueEmpty</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">QueueEmpty</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
22
<span class="k">this</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;QueueEmpty&quot;</span><span class="p">;</span>
33
<span class="k">this</span><span class="p">.</span><span class="nx">message</span> <span class="o">=</span> <span class="s2">&quot;Queue is Empty&quot;</span><span class="p">;</span>
44
<span class="p">};</span>

docs/stomp-utils.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html> <html> <head> <title>stomp-utils.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp-utils.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">exceptions</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./stomp-exceptions&#39;</span><span class="p">);</span>
1+
<!DOCTYPE html> <html> <head> <title>stomp-utils.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="index.html"> index.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp-utils.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">exceptions</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./stomp-exceptions&#39;</span><span class="p">);</span>
22
<span class="kd">var</span> <span class="nx">sys</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span>
33

44
<span class="nx">StompLogging</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">StompLogging</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">should_debug</span><span class="p">)</span> <span class="p">{</span>

docs/stomp.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html> <html> <head> <title>stomp.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h2>stomp</h2>
1+
<!DOCTYPE html> <html> <head> <title>stomp.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="frame.html"> frame.js </a> <a class="source" href="index.html"> index.js </a> <a class="source" href="stomp-exceptions.html"> stomp-exceptions.js </a> <a class="source" href="stomp-utils.html"> stomp-utils.js </a> <a class="source" href="stomp.html"> stomp.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> stomp.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h2>stomp</h2>
22

33
<p>The <code>Stomp</code> module provides you with a client interface for interacting with STOMP messaging brokers</p>
44

lib/index.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// # stomp-js
2+
//
3+
// ## Overview
4+
//
5+
// An exercise with node.js to implement the STOMP protocol.
6+
//
7+
// For documentation see doc/stomp.md and doc/frame.md
8+
//
9+
// ## Installation
10+
//
11+
// `npm install stomp`
12+
//
13+
// `git clone https://benjaminws@github.com/benjaminws/stomp-js.git`
14+
//
15+
// ## Examples
16+
//
17+
// ### Consumer
18+
//
19+
// See examples/stomp-consumer.js
20+
//
21+
// ### Producer
22+
//
23+
// See examples/stomp-producer.js
24+
//
25+
// ### Producer with Transaction Support
26+
//
27+
// See examples/stomp-producer-txn.js

lib/stomp.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Stomp.prototype.disconnect = function() {
309309
}
310310

311311
//
312-
// ## Stomp.subscribe()
312+
// ## Stomp.subscribe(headers, callback)
313313
//
314314
// **Subscribe to destination (queue or topic)**
315315
//
@@ -321,6 +321,20 @@ Stomp.prototype.subscribe = function(headers, callback) {
321321
var destination = headers['destination'];
322322
headers['session'] = this.session;
323323
send_command(this, 'SUBSCRIBE', headers);
324+
325+
/**
326+
/ Maybe we could subscribe to mulitple queues?
327+
/ if (destination instanceof Array) {
328+
/ for (var = i; i < 0; i++) {
329+
/ this._subscribed_to[destination[i]] = { enabled: true, callback: callback };
330+
/ }
331+
/ }
332+
/ else {
333+
/ this._subscribed_to[destination] = { enabled: true, callback: callback };
334+
/ }
335+
/
336+
*/
337+
324338
this._subscribed_to[destination] = { enabled: true, callback: callback };
325339
this.log.debug('subscribed to: ' + destination + ' with headers ' + sys.inspect(headers));
326340
};

0 commit comments

Comments
 (0)