Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The natural style is sweet for things like that. I did the Hype.la signup process with natural style and it meant I didn't have to touch the database the whole time. If they quit half-way through then no DB junk left over.

Where this kind of coroutine stuff sucks though is in anything that's "RESTy". In other parts of Hype.la I had simple Xhr callbacks that just grabbed lists of data, so the coroutines were just annoyingly in the way and half the time they were just a big loop with an if-statement for the URLs.

That's where the evented came in. In that way I just map actions to callbacks and done.

Then I ran into a few simple things that didn't work in evented and were still stateless, like the search interface, and so I use the stateless handler for that. Nice and snappy with no extra junk.

Another advantage of all this is that, if you have a part of your app that needs to be resistant to restarts, then you can craft it evented or stateless. In other parts, restarts aren't a big deal so you can do natural. And since everything is just a bunch of little processes, it scales out nice and doesn't have as much of the "gotta-copy-the-world-for-users" that Seaside upgrades do.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: