SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Generation 5 » Managing Concurrency With Asynchronous HTTP Requests

 Subscribe to our RSS Feed | About Us

Managing Concurrency With Asynchronous HTTP Requests
I developed a rather complicated GWT application last summer and spent plenty of
time struggling with the concurrency issues involved with with applications that use
asynchronous web requests: for instance, the HttpWebRequest in Silverlight or the
XmlHttpRequest in Javascript. Up until Silverlight 2 beta, Silverlight programmers could
perform synchronous requests, but the latest version of Silverlight supports only
asynchronous requests… We’re scrambling to update our apps.
There’s a “standard model” that works for writing reliable, performant and secure
RIAs — it works for GWT, Flex, and Silverlight and plain old AJAX apps too.
The model is that one user UI action should cause one http request with the server
and the server should send back a bundle of data that has everything needed to
update client state and redraw.
Sound familiar? This is the proven model that conventional web applications use — it
works, unlike the generation of failed “client/server” apps we saw in the 90′s that
showed that the general problem of client/server choreography is hard to do in
practice; particularly with a system like GWT that offers very little support for dealing
with concurrency.
Put all the business logic on the server; maybe you can do some form validation on
the client, but do it again on the server. Since GWT and Silverlight let you code with
the same language on client and server, it’s easy to share code.
Both client and server can send each other “state update” packets that bundle an
arbitrary number of commands that are, preferentially, bundled into a single
transaction.
Note that this goes against the general principle that complicated operations should
be done by composing them out of simpler operations — that’s an excellent principle
for developing object-oriented systems that live in a single address space, but it’s a
dangerous way to build applications in distributed systems: if a client operation
requires 20 web requests, a reliable application needs to do something correct when
19 of those operations succeed and 1 of them fails — never mind the cost in latency.
Now, it’s not possible to do this in every case: there really are cases where you need
to connect to a legacy server that you can’t redesign, where there constraints on the
client-server protocol, or you can save bandwidth by having the client make selective
results (if some information is cached.) If you’re going to do that, you need design
patterns that provide reliable answers to common problems. I’ll be talking about that
in the next few days.

Paul Houle on March 27th 2008 in Asynchronous Communications, Dot Net

Comments (3)

Comments (3)

Login

Sort by: Date Rating Last Activity

Generation 5 » Optimistic Locking For Retrieving Result Sets

[...] then you’re displaying the result of the search. The most reliable way to do this is to use Pattern
Zero, which is, do a single request to the server that retrieves all the information — in that [...]
Thibaud Lopez Schnei · 289 weeks ago

0

Hi, I wrote a paper that proposes simple rules to transform synchronous code to asynchronouse code:
http://www.thibaudlopez.net/xhr/Writing%20effecti... . Hope it helps! (I'm sorry it's still in PDF format
and has no examples yet, just pseudo code.)

http://gen5.info/q/2008/03/27/managing-concurrency-with-asynchronous-http-requests/[1/12/2014 8:33:22 PM]

Search for:
Search

Archives

June 2012 (1)
August 2010 (1)
May 2010 (1)
June 2009 (2)
April 2009 (1)
March 2009 (1)
February 2009 (3)
January 2009 (3)
November 2008 (1)
August 2008 (2)
July 2008 (5)
June 2008 (5)
May 2008 (2)
April 2008 (6)
March 2008 (8)
June 2006 (1)
February 2006 (1)

Categories

AJAX (2)
Asynchronous Communications (16)
Biology (1)
Books (1)
Design (1)
Distributed (1)
Exceptions (2)
Functional Programming (1)
GIS (1)
Ithaca (1)
Japan (1)
Math (1)
Media (3)
Nature (1)
Semantic Web (3)
Tools (28)
CRUD (1)
Dot Net (17)
Freebase (2)
GWT (9)
Java (7)
Linq (2)
PHP (6)
Server Frameworks (1)
Silverlight (12)
SQL (5)
Uncategorized (1)
Web (2)
Analytics (1)
Generation 5 » Managing Concurrency With Asynchronous HTTP Requests

Reply

Generation 5 » Converting A Synchronous Program Into An Asynchronous Program

[...] and GWT)  is expressing the flow of control between multiple asynchronous XHR calls.  A “one-clickone-XHR” policy is often best,  but you don’t always have control over your client-server [...]

Post a new comment
Enter text right here!

Comment as a Guest, or login:
Name

Email

Website (optional)

Displayed next to your comments.

Not displayed publicly.

If you have a website, link to it here.

None
Subscribe to None

Submit Comment

Copyright © 2013 Generation 5.
WordPress Theme design.

http://gen5.info/q/2008/03/27/managing-concurrency-with-asynchronous-http-requests/[1/12/2014 8:33:22 PM]

Contenu connexe

En vedette

Visualising Quantum Physics using Mathematica
Visualising Quantum Physics using MathematicaVisualising Quantum Physics using Mathematica
Visualising Quantum Physics using MathematicaAndreas Dewanto
 
Essential rewards flyer
Essential rewards flyerEssential rewards flyer
Essential rewards flyerKristy Dempsey
 
Student Mentorship in Special Programme in Science
Student Mentorship in Special Programme in ScienceStudent Mentorship in Special Programme in Science
Student Mentorship in Special Programme in ScienceAndreas Dewanto
 
Let's Take A Look: Cecil & Allyn Shankel
Let's Take A Look: Cecil & Allyn ShankelLet's Take A Look: Cecil & Allyn Shankel
Let's Take A Look: Cecil & Allyn Shankelesme iolanthe
 
Austin as a Digital Media Nexus. Presentation to the Technology Advisors Gro...
Austin as a Digital Media Nexus.  Presentation to the Technology Advisors Gro...Austin as a Digital Media Nexus.  Presentation to the Technology Advisors Gro...
Austin as a Digital Media Nexus. Presentation to the Technology Advisors Gro...Frank Coppersmith
 
Transistores
TransistoresTransistores
Transistoresdpareja01
 
Spanish colonization
Spanish colonizationSpanish colonization
Spanish colonizationWenny Wang Wu
 
La competencia mediática
La competencia mediáticaLa competencia mediática
La competencia mediáticaBlanca Rubiales
 
Five themes of geography The caribbean
Five themes of geography The caribbeanFive themes of geography The caribbean
Five themes of geography The caribbeanWenny Wang Wu
 
Consistencia entre las estucturas pragmáticas, semánticas y sintácticas
Consistencia entre las estucturas pragmáticas, semánticas y sintácticasConsistencia entre las estucturas pragmáticas, semánticas y sintácticas
Consistencia entre las estucturas pragmáticas, semánticas y sintácticasProf. Ana Margarita Durán
 
використання ікт на уроках в сучасній школі
використання ікт на уроках в сучасній школівикористання ікт на уроках в сучасній школі
використання ікт на уроках в сучасній школіserdj phil
 
Dasar Kerja Sistem EFI
Dasar Kerja Sistem EFIDasar Kerja Sistem EFI
Dasar Kerja Sistem EFIciero
 
інтерактивне навчання
інтерактивне навчанняінтерактивне навчання
інтерактивне навчанняserdj phil
 

En vedette (19)

Visualising Quantum Physics using Mathematica
Visualising Quantum Physics using MathematicaVisualising Quantum Physics using Mathematica
Visualising Quantum Physics using Mathematica
 
Essential rewards flyer
Essential rewards flyerEssential rewards flyer
Essential rewards flyer
 
Student Mentorship in Special Programme in Science
Student Mentorship in Special Programme in ScienceStudent Mentorship in Special Programme in Science
Student Mentorship in Special Programme in Science
 
Andreaalpizar comic
Andreaalpizar comicAndreaalpizar comic
Andreaalpizar comic
 
Not need life,not need honor,not need money
Not need life,not need honor,not need moneyNot need life,not need honor,not need money
Not need life,not need honor,not need money
 
Hypnotist
HypnotistHypnotist
Hypnotist
 
CCNA1
CCNA1CCNA1
CCNA1
 
Let's Take A Look: Cecil & Allyn Shankel
Let's Take A Look: Cecil & Allyn ShankelLet's Take A Look: Cecil & Allyn Shankel
Let's Take A Look: Cecil & Allyn Shankel
 
Redes sociales Christian Núñez
Redes sociales   Christian NúñezRedes sociales   Christian Núñez
Redes sociales Christian Núñez
 
January 6
January 6January 6
January 6
 
Austin as a Digital Media Nexus. Presentation to the Technology Advisors Gro...
Austin as a Digital Media Nexus.  Presentation to the Technology Advisors Gro...Austin as a Digital Media Nexus.  Presentation to the Technology Advisors Gro...
Austin as a Digital Media Nexus. Presentation to the Technology Advisors Gro...
 
Transistores
TransistoresTransistores
Transistores
 
Spanish colonization
Spanish colonizationSpanish colonization
Spanish colonization
 
La competencia mediática
La competencia mediáticaLa competencia mediática
La competencia mediática
 
Five themes of geography The caribbean
Five themes of geography The caribbeanFive themes of geography The caribbean
Five themes of geography The caribbean
 
Consistencia entre las estucturas pragmáticas, semánticas y sintácticas
Consistencia entre las estucturas pragmáticas, semánticas y sintácticasConsistencia entre las estucturas pragmáticas, semánticas y sintácticas
Consistencia entre las estucturas pragmáticas, semánticas y sintácticas
 
використання ікт на уроках в сучасній школі
використання ікт на уроках в сучасній школівикористання ікт на уроках в сучасній школі
використання ікт на уроках в сучасній школі
 
Dasar Kerja Sistem EFI
Dasar Kerja Sistem EFIDasar Kerja Sistem EFI
Dasar Kerja Sistem EFI
 
інтерактивне навчання
інтерактивне навчанняінтерактивне навчання
інтерактивне навчання
 

Plus de Paul Houle

Chatbots in 2017 -- Ithaca Talk Dec 6
Chatbots in 2017 -- Ithaca Talk Dec 6Chatbots in 2017 -- Ithaca Talk Dec 6
Chatbots in 2017 -- Ithaca Talk Dec 6Paul Houle
 
Estimating the Software Product Value during the Development Process
Estimating the Software Product Value during the Development ProcessEstimating the Software Product Value during the Development Process
Estimating the Software Product Value during the Development ProcessPaul Houle
 
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...Universal Standards for LEI and other Corporate Reference Data: Enabling risk...
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...Paul Houle
 
Fixing a leaky bucket; Observations on the Global LEI System
Fixing a leaky bucket; Observations on the Global LEI SystemFixing a leaky bucket; Observations on the Global LEI System
Fixing a leaky bucket; Observations on the Global LEI SystemPaul Houle
 
Cisco Fog Strategy For Big and Smart Data
Cisco Fog Strategy For Big and Smart DataCisco Fog Strategy For Big and Smart Data
Cisco Fog Strategy For Big and Smart DataPaul Houle
 
Making the semantic web work
Making the semantic web workMaking the semantic web work
Making the semantic web workPaul Houle
 
Ontology2 platform
Ontology2 platformOntology2 platform
Ontology2 platformPaul Houle
 
Ontology2 Platform Evolution
Ontology2 Platform EvolutionOntology2 Platform Evolution
Ontology2 Platform EvolutionPaul Houle
 
Paul houle the supermen
Paul houle   the supermenPaul houle   the supermen
Paul houle the supermenPaul Houle
 
Paul houle what ails enterprise search
Paul houle   what ails enterprise search Paul houle   what ails enterprise search
Paul houle what ails enterprise search Paul Houle
 
Subjective Importance Smackdown
Subjective Importance SmackdownSubjective Importance Smackdown
Subjective Importance SmackdownPaul Houle
 
Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Paul Houle
 
Dropping unique constraints in sql server
Dropping unique constraints in sql serverDropping unique constraints in sql server
Dropping unique constraints in sql serverPaul Houle
 
Prefix casting versus as-casting in c#
Prefix casting versus as-casting in c#Prefix casting versus as-casting in c#
Prefix casting versus as-casting in c#Paul Houle
 
Paul houle resume
Paul houle resumePaul houle resume
Paul houle resumePaul Houle
 
Keeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacksKeeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacksPaul Houle
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHPPaul Houle
 
What do you do when you’ve caught an exception?
What do you do when you’ve caught an exception?What do you do when you’ve caught an exception?
What do you do when you’ve caught an exception?Paul Houle
 
Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Paul Houle
 
Pro align snap 2
Pro align snap 2Pro align snap 2
Pro align snap 2Paul Houle
 

Plus de Paul Houle (20)

Chatbots in 2017 -- Ithaca Talk Dec 6
Chatbots in 2017 -- Ithaca Talk Dec 6Chatbots in 2017 -- Ithaca Talk Dec 6
Chatbots in 2017 -- Ithaca Talk Dec 6
 
Estimating the Software Product Value during the Development Process
Estimating the Software Product Value during the Development ProcessEstimating the Software Product Value during the Development Process
Estimating the Software Product Value during the Development Process
 
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...Universal Standards for LEI and other Corporate Reference Data: Enabling risk...
Universal Standards for LEI and other Corporate Reference Data: Enabling risk...
 
Fixing a leaky bucket; Observations on the Global LEI System
Fixing a leaky bucket; Observations on the Global LEI SystemFixing a leaky bucket; Observations on the Global LEI System
Fixing a leaky bucket; Observations on the Global LEI System
 
Cisco Fog Strategy For Big and Smart Data
Cisco Fog Strategy For Big and Smart DataCisco Fog Strategy For Big and Smart Data
Cisco Fog Strategy For Big and Smart Data
 
Making the semantic web work
Making the semantic web workMaking the semantic web work
Making the semantic web work
 
Ontology2 platform
Ontology2 platformOntology2 platform
Ontology2 platform
 
Ontology2 Platform Evolution
Ontology2 Platform EvolutionOntology2 Platform Evolution
Ontology2 Platform Evolution
 
Paul houle the supermen
Paul houle   the supermenPaul houle   the supermen
Paul houle the supermen
 
Paul houle what ails enterprise search
Paul houle   what ails enterprise search Paul houle   what ails enterprise search
Paul houle what ails enterprise search
 
Subjective Importance Smackdown
Subjective Importance SmackdownSubjective Importance Smackdown
Subjective Importance Smackdown
 
Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#
 
Dropping unique constraints in sql server
Dropping unique constraints in sql serverDropping unique constraints in sql server
Dropping unique constraints in sql server
 
Prefix casting versus as-casting in c#
Prefix casting versus as-casting in c#Prefix casting versus as-casting in c#
Prefix casting versus as-casting in c#
 
Paul houle resume
Paul houle resumePaul houle resume
Paul houle resume
 
Keeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacksKeeping track of state in asynchronous callbacks
Keeping track of state in asynchronous callbacks
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHP
 
What do you do when you’ve caught an exception?
What do you do when you’ve caught an exception?What do you do when you’ve caught an exception?
What do you do when you’ve caught an exception?
 
Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#Extension methods, nulls, namespaces and precedence in c#
Extension methods, nulls, namespaces and precedence in c#
 
Pro align snap 2
Pro align snap 2Pro align snap 2
Pro align snap 2
 

Dernier

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Dernier (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Managing concurrency with asynchronous http requests

  • 1. Generation 5 » Managing Concurrency With Asynchronous HTTP Requests  Subscribe to our RSS Feed | About Us Managing Concurrency With Asynchronous HTTP Requests I developed a rather complicated GWT application last summer and spent plenty of time struggling with the concurrency issues involved with with applications that use asynchronous web requests: for instance, the HttpWebRequest in Silverlight or the XmlHttpRequest in Javascript. Up until Silverlight 2 beta, Silverlight programmers could perform synchronous requests, but the latest version of Silverlight supports only asynchronous requests… We’re scrambling to update our apps. There’s a “standard model” that works for writing reliable, performant and secure RIAs — it works for GWT, Flex, and Silverlight and plain old AJAX apps too. The model is that one user UI action should cause one http request with the server and the server should send back a bundle of data that has everything needed to update client state and redraw. Sound familiar? This is the proven model that conventional web applications use — it works, unlike the generation of failed “client/server” apps we saw in the 90′s that showed that the general problem of client/server choreography is hard to do in practice; particularly with a system like GWT that offers very little support for dealing with concurrency. Put all the business logic on the server; maybe you can do some form validation on the client, but do it again on the server. Since GWT and Silverlight let you code with the same language on client and server, it’s easy to share code. Both client and server can send each other “state update” packets that bundle an arbitrary number of commands that are, preferentially, bundled into a single transaction. Note that this goes against the general principle that complicated operations should be done by composing them out of simpler operations — that’s an excellent principle for developing object-oriented systems that live in a single address space, but it’s a dangerous way to build applications in distributed systems: if a client operation requires 20 web requests, a reliable application needs to do something correct when 19 of those operations succeed and 1 of them fails — never mind the cost in latency. Now, it’s not possible to do this in every case: there really are cases where you need to connect to a legacy server that you can’t redesign, where there constraints on the client-server protocol, or you can save bandwidth by having the client make selective results (if some information is cached.) If you’re going to do that, you need design patterns that provide reliable answers to common problems. I’ll be talking about that in the next few days. Paul Houle on March 27th 2008 in Asynchronous Communications, Dot Net Comments (3) Comments (3) Login Sort by: Date Rating Last Activity Generation 5 » Optimistic Locking For Retrieving Result Sets [...] then you’re displaying the result of the search. The most reliable way to do this is to use Pattern Zero, which is, do a single request to the server that retrieves all the information — in that [...] Thibaud Lopez Schnei · 289 weeks ago 0 Hi, I wrote a paper that proposes simple rules to transform synchronous code to asynchronouse code: http://www.thibaudlopez.net/xhr/Writing%20effecti... . Hope it helps! (I'm sorry it's still in PDF format and has no examples yet, just pseudo code.) http://gen5.info/q/2008/03/27/managing-concurrency-with-asynchronous-http-requests/[1/12/2014 8:33:22 PM] Search for: Search Archives June 2012 (1) August 2010 (1) May 2010 (1) June 2009 (2) April 2009 (1) March 2009 (1) February 2009 (3) January 2009 (3) November 2008 (1) August 2008 (2) July 2008 (5) June 2008 (5) May 2008 (2) April 2008 (6) March 2008 (8) June 2006 (1) February 2006 (1) Categories AJAX (2) Asynchronous Communications (16) Biology (1) Books (1) Design (1) Distributed (1) Exceptions (2) Functional Programming (1) GIS (1) Ithaca (1) Japan (1) Math (1) Media (3) Nature (1) Semantic Web (3) Tools (28) CRUD (1) Dot Net (17) Freebase (2) GWT (9) Java (7) Linq (2) PHP (6) Server Frameworks (1) Silverlight (12) SQL (5) Uncategorized (1) Web (2) Analytics (1)
  • 2. Generation 5 » Managing Concurrency With Asynchronous HTTP Requests Reply Generation 5 » Converting A Synchronous Program Into An Asynchronous Program [...] and GWT)  is expressing the flow of control between multiple asynchronous XHR calls.  A “one-clickone-XHR” policy is often best,  but you don’t always have control over your client-server [...] Post a new comment Enter text right here! Comment as a Guest, or login: Name Email Website (optional) Displayed next to your comments. Not displayed publicly. If you have a website, link to it here. None Subscribe to None Submit Comment Copyright © 2013 Generation 5. WordPress Theme design. http://gen5.info/q/2008/03/27/managing-concurrency-with-asynchronous-http-requests/[1/12/2014 8:33:22 PM]