Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
you’re on your way 4
197
asynchronous applications
A synchronous test drive
When you run the synchronous version of the coffee maker application,
you should notice quite a big difference. As soon as you click on “Order
Coffee”, you’re stuck. The button stays highlighted, and if you try to
enter another order, you get the spinning beach ball (on Macs) or the
hourglass (on Windows), meaning “You’ll have to waitI’m busy!”
As soon as you click on “Order
Coffee”, you’re stuck.
Nothing else can happen until the
response comes back from the
server. You won’t even see the
status of the coffee maker change,
because that code can’t run!
If you try to do something else, like
start a new order, you won’t see
anything happen, because everything is
frozen until that response comes back.
You just get your system’s “wait” icon.
The coffee is nished brewing,
the status of the rst coffee
maker is set to “Idle” (because it’s
done brewing again), and you never
actually see the “Brewing” status.
All that work to add another request
object, and now you can’t even use
it. Synchrony sucks when it comes to
coffee makers!
...time passes...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content