Hi Anthony,

So ... If I, say, wanted to send all new clients the message "hello"
when they joined on a private channel, I'd have something like this:

Ape.addEvent('init',function() { chan = Ape.mkChan("*private"); });
Ape.addEvent('adduser',function(user) { user.join("*private");
chan.pipe.sendRaw("hello"); });

Or would I need to get the client to request the messages with a
custom command?

Also I'm not completely sure about how the * works exactly: the
documentation is a rather vauge about this.  Does it mean that the
clients cannot see the messages being sent by other clients on the
same channel?  If this is supposed to be the case, then I've got some
code which doesn't work the way I'd expect.

Thanks!



2010/1/3 Anthony Catel <[email protected]>:
> Hi Chris,
>
> Indeed, you can force each users to join a private channel (the channel
> name must start with a star (*)).
> You can do that by writting a little server-side JS module with the help
> of :
>
> - Ape.addEvent('init', function() { chan = Ape.mkChan("*something")} ;
> - Ape.addEvent('adduser', function(user) { user.join('*something) });
>
> Then sending message with chan.pipe.sendRaw()
>
> Anthony
>
> Le 31/12/09 00:40, Chris R a écrit :
>> Hi list,
>>
>> Hope you've all had a pleasant holiday season so far!
>>
>> I'm working on a project which involves recieving SMSes through a web
>> interface in "real time".
>>
>> When the clients are connected, they join a channel which they can
>> listen on - this channel has the messages sent to it and all the
>> clients recieve it at once.  However, this means that if a client
>> connects later, it will not have any record of messages sent
>> previously (which is important in our case).  At the point at which we
>> send the message to the channel, we are also logging it in a MySQL
>> db.
>>
>> Is there any preferred way of letting new clients "catch up"?  My
>> thought was to have a "public" channel where all new messages are
>> sent, and then a private pipe which each client sets up where it
>> initially connects to, and asks for all the messages which have been
>> sent since a certain time (with a command like GET_MESSAGES_SINCE with
>> a parameter of a timestamp).
>>
>> I'm really pleased with what I've seen of the APE project so far -
>> perfect for what I want to do !
>>
>> Cheers,
>>
>> Chris R
>>
>> Volunteer Engineer
>> CSR FM 97.4, Canterbury, UK
>> http://www.csrfm.com/
>>
>>
>
> --
> 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/
>

---
Chris R

Volunteer Engineer
CSR FM 97.4, Canterbury, UK
http://www.csrfm.com/

-- 
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/

Reply via email to