There is no global userlist variable for ape 1.x, I extended the
g_ape->properties for store this by my self.
I'm not familiar with inlinepush and SSJS, I do this in C way on the
following for reference:
#define MAKE_USER_TBL(g_ape) \
do { \
if (get_property(g_ape->properties, "userlist") == NULL) { \
add_property(&g_ape->properties, "userlist", hashtbl_init(), NULL, \
EXTEND_HTBL, EXTEND_ISPRIVATE); \
} \
} while (0)
#define SET_USER_FOR_APE(g_ape, nickname, user) \
do { \
hashtbl_append(get_property(g_ape->properties, "userlist")->val, \
nickname, user); \
} while (0)
#define GET_USER_FROM_APE(g_ape, nickname) \
(get_property(g_ape->properties, "userlist") != NULL ? \
(USERS*)hashtbl_seek(get_property(g_ape->properties, "userlist")->val,
nickname): NULL)
After we SET_USER_FOR_APE(), we can post to any user through his nickname by
this way:
post_raw(newraw, GET_USER_FROM_APE(g_ape, nickname), g_ape);
2011/1/26 Teguh Eko Budiarto <[email protected]>
> Hi Ma Liang,
>
> Could you please explain more, how do you get the pubid of the user you
> want to send the message to by using its nickname, if we already set the
> user nickname property?
>
> What is the connected users list variable?
>
> Thanks,
>
>
>
> On Fri, Dec 31, 2010 at 10:42 AM, ma liang <[email protected]> wrote:
>
>> You don't need to create a new channel for each user, because every user
>> have it's own pubid you can post to.
>>
>> According my test, ape can handle 10,000 user's request fine.
>>
>> 2010/12/29 geekforever <[email protected]>
>>
>> Hello,
>>>
>>> I'm planning to build a web application that allows users to get
>>> notified "live" when PHP performs changes in the database.
>>> I used the PHP controller example for inline pushing: I was thinking
>>> about creating a new channel for each user. Is it a good idea knowing
>>> that the website users number can reach 10,000 ?
>>>
>>> I don't know how to start, what would your first suggestions, the
>>> global steps ?
>>>
>>> --
> 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]<ape-project%[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/
>
--
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/