Skip to content

Commit 1a5aeb1

Browse files
committed
broker: Add listSubscriptions() API
1 parent 3f999ec commit 1a5aeb1

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/amqp.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ class MessageBroker extends Client
201201
return callback null
202202
unsubscribeData: (binding, datahandler, callback) -> # TODO: implement
203203
return callback null
204+
listSubscriptions: (callback) -> # TODO: implement
205+
return callback null, []
204206

205207
# Participant registration
206208
subscribeParticipantChange: (handler) ->

src/interfaces.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ class MessageBroker extends MessagingSystem
7171
throw new Error 'Not Implemented'
7272
unsubscribeData: (binding, datahandler, callback) ->
7373
throw new Error 'Not Implemented'
74+
listSubscriptions: (callback) ->
75+
throw new Error 'Not Implemented'
7476

7577
# Participant registration
7678
subscribeParticipantChange: (handler) ->

src/routing.coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ class Binder
9191
return callback new Error "Subscription was not found" if handlerIndex == -1
9292
subscription.handlers = subscription.handlers.splice(handlerIndex, 1)
9393
return callback null
94+
listSubscriptions: (callback) ->
95+
subs = []
96+
for id, sub of @subscriptions
97+
subs.push sub
98+
return callback null, subs
99+
94100

95101
exports.Binder = Binder
96102
exports.binderMixin = (transport) ->
@@ -101,4 +107,5 @@ exports.binderMixin = (transport) ->
101107
transport.listBindings = b.listBindings.bind b
102108
transport.subscribeData = b.subscribeData.bind b
103109
transport.unsubscribeData = b.unsubscribeData.bind b
110+
transport.listSubscriptions = b.listSubscriptions.bind b
104111

0 commit comments

Comments
 (0)