About my 'onSend issue', I'm currently using a dedicated custom pipe
to receive 'commands' from user directly in my class instance.
//on server side, a custom pipe is instanciated for each channel ;
// its pubid is published thru channel's property 'cmdPipePubid'.
var MyChanWrapper = new Class({
initialize: function(options) {
// [...]
this.cmdPipe = new Ape.pipe();
this.cmdPipe.onSend = this.onChannelMsgReceived.create({bind:
this});
this.channel = Ape.mkChan("myChanName");
this.channel.setProperty("cmdPipePubid",
this.cmdPipe.getProperty('pubid'));
}
onChannelMsgReceived: function(user, params) {
Ape.log("Received some data for binded channel
"+this.channel.name);
}
//[...]
// on client side, I catch all 'multiPipeCreate' events.
// If a new channel with a 'cmdPipePubid' property is detected,
// the cmdPipe is instanciated and added to the channel's reference.
client.addEvent('multiPipeCreate', function(pipe, options) {
if (pipe.properties.cmdPipePubid != null) {
pipe.cmdPipe = client.core.newPipe('uni', {"pipe": {pubid:
pipe.properties.cmdPipePubid}});
// Channel with cmdPipe joined. I can now
// send commands to it using 'theChannel.cmdPipe.send()'
function.
}
});
In other words, I have:
- the 'regular' channel to let the server broadcast messages.
- plus one custom pipe to let clients send 'commands' directly to the
channel's wrapper.
For sure there must be several ways to do that in a less ugly manner.
If anyone has got ideas, don't hesitate to tell them :-D
Regards,
Nouk²
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/