I received a patch for OpaDo from Francois Regis Sinot that has made the hosted OpaDo http://opado.org on Dotcloud MUCH faster, adding and removing item is now instantaneous. He placed @publish around explicitly server side functions that caused adding todo items to go from 21 to 1 server calls. I thought this simple but maybe not obvious for new Opa developers (it certainly wasn't to me!) needed a blog post so that beginners like my self may find it and be able to start using the @publish directive. Check out the Opa manual for some more information on @publish, specifically I'd look at Section 4.7.4 and 10.2

Below are the changes he made. Which you can also of see in the commit diff on Github and check out the entire source.

 
- @async
- dbmakedone(username: string, id: string) =
+ @publish @async
+ dbmakedone(id: string) =
+ username = User.getusername()
items = /todo
items[username]
item = Option.get(StringMap.get(id, items))
/todo_items[username] <- StringMap.add(id, {item with done=true}, items)

- @async
+ @publish @async
dbremoveitem(id: string) =
username = User.getusername()
items = /todo
items[username]

- @async
+ @publish @async
dbaddtodo(id: string, x: string) =
username = User.getusername()
items = /todo
items[username]
/todoitems[username] <- StringMap.add(id, { value=x done=false createdat="" }, items)

+ @publish
addtodos() =
username = User.get
username()
items = /todo_items[username]