On Jul 24, 2010, at 6:44 AM, Mark wrote:

> Hi,
> 
> I'm looking to implement a pub/sub mechanism for my web app, similar
> to twitter. Users can follow one another. When a user performs some
> action, I'd like their followers to be able to see those actions in
> their follower stream.
> 
> I can't figure a good way to do this on app engine. The most naive
> implementation would be to write a record per follower when an action
> is performed, like:
> 
>   public void userAction(String username, String actionDescription) {
>       List<Follower> followers = getAllFriends(username);
>       for (Follower it : followers) {
>           Action action = new Action(it.getUsername(),
> actionDescription);
>           pm.makePersistent(action);
>       }
>   }
> 

You might want to take a look at this Google I/O talk:

Google I/O 2009: Scalable, Complex Apps on AppEngine
http://www.youtube.com/watch?v=AgaL6NGpkB8

Although the examples are in Python, they're still more or less applicable to 
Java as well. There is one example with your use case.

HTH

Jan Michael Ibanez
jmiba...@gmail.com



-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to