Skip to content

Commit c51898a

Browse files
committed
Issue #1 Allow deletion of durable subscriptions by adding headers to the unsubscribe call
1 parent 3b60a70 commit c51898a

File tree

3 files changed

+75
-74
lines changed

3 files changed

+75
-74
lines changed

lib/stomp-node.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/stomp.js

Lines changed: 68 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/stomp.coffee

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ class Client
362362
return {
363363
id: headers.id
364364

365-
unsubscribe: ->
366-
client.unsubscribe headers.id
365+
unsubscribe: (hdrs) ->
366+
client.unsubscribe headers.id, hdrs
367367
}
368368

369369
# [UNSUBSCRIBE Frame](http://stomp.github.com/stomp-specification-1.1.html#UNSUBSCRIBE)
@@ -375,12 +375,11 @@ class Client
375375
#
376376
# var subscription = client.subscribe(destination, onmessage);
377377
# ...
378-
# subscription.unsubscribe();
379-
unsubscribe: (id) ->
378+
# subscription.unsubscribe(headers);
379+
unsubscribe: (id, headers={}) ->
380380
delete @subscriptions[id]
381-
@_transmit "UNSUBSCRIBE", {
382-
id: id
383-
}
381+
headers.id = id
382+
@_transmit "UNSUBSCRIBE", headers
384383

385384
# [BEGIN Frame](http://stomp.github.com/stomp-specification-1.1.html#BEGIN)
386385
#

0 commit comments

Comments
 (0)