sbordet on 2013-12-23T16:05:21Z:
CometD's subscribe() method returns a value, which is a problem because async functions must not return a value.
Perhaps there is value in changing subscribe()'s callback to take the subscription object as parameter, in addition to the message, however this will break the existing applications because they expect the return value.
We could add register()/unregister() to differentiate, or make the return value of subscribe() both a subscription object and a promise.
I think the only benefit would be for request/replies. Everytime you subscribe you create a new Promise and when you get something back the promise gets resolved. I wouldn't use Promises though for notification channels where you remain subscribed cause Promises wouldn't work. I think the best candidate is the remoteCall