Opened 13 years ago
Closed 8 years ago
#5963 closed enhancement (wontfix)
Comet - subscribing to a glob channel
Reported by: | guest | Owned by: | dylan |
---|---|---|---|
Priority: | high | Milestone: | future |
Component: | DojoX Cometd | Version: | 1.0 |
Keywords: | comet, glob, subscribe, channel | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description (last modified by )
Subscribing to the * channels doesn't seem to work. Let's say we have the channels /foo and /bar. When the user subscribes to /*, the user does a client-side dojo.subscribe to /*, but the actual message will be published to either /foo or /bar on the client side. In other words, the server delivers the messages to the client, but the client is listening on a different Dojo channel.
I wasn't sure what to set the ticket properties to, so I'm hoping somebody else will edit them.
-Geoffrey Lee
Change History (12)
comment:1 Changed 13 years ago by
Milestone: | → 1.2 |
---|---|
Owner: | changed from anonymous to alex |
Status: | new → assigned |
comment:2 Changed 13 years ago by
Milestone: | 1.2 → 1.1 |
---|
comment:3 Changed 13 years ago by
I think this is simply because dojo.subscribe does not support wild cards.
So I think that when we receive a message on channel /foo/bar/boo then we should publish it to dojo topics:
/cometd/ /cometd/foo/ /cometd/foo/bar/ /cometd/foo/bar/* /cometd/foo/bar/boo
Is that reasonable?
comment:4 Changed 13 years ago by
Seems reasonable to me. Here's the modified code for dojox.cometd._deliver that I'm using to do this:
// dispatch the message to any locally subscribed listeners try { var tname = "/cometd"+message.channel; dojo.publish(tname, [ message ]); // Begin changes var tnameParts = message.channel.split("/"); var tnameGlob = "/cometd"; for (var i = 1; i < tnameParts.length - 1; i++) { dojo.publish(tnameGlob + "/**", [ message ]); tnameGlob += "/" + tnameParts[i]; } dojo.publish(tnameGlob + "/**", [ message ]); dojo.publish(tnameGlob + "/*", [ message ]); // End changes }catch(e){ console.debug(e); }
-Geoffrey Lee
comment:5 Changed 13 years ago by
Great!
I've committed with the slight change of publishing to the real topic after the glob topics, so that it is like we have descended the tree.
If you can test this, I will see if it can make it into 1.1
comment:6 Changed 13 years ago by
Component: | General → Dojox |
---|---|
Milestone: | 1.1 → 1.2 |
Move all milestone 1.1 tickets to 1.2, except for reopened tickets and tickets opened after 1.1RC1 was released.
comment:7 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:8 Changed 13 years ago by
Component: | Dojox → DojoX Cometd |
---|
comment:9 Changed 12 years ago by
Type: | defect → enhancement |
---|
comment:10 Changed 12 years ago by
Milestone: | 1.2 → future |
---|
comment:12 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
The CometD library has been removed from DojoX. The CometD project now maintains its own Dojo library in AMD format as part of their project. This will be available via cpm, or may be downloaded from GitHub?. See: http://cometd.org/
move back to 1.1 per request by Greg Wilkins.