One man's hack is another man's... <wink> Let me argue why "traditional server push" has a much lower quality of service and why this design pattern IMHO is a whole lot less of a hack then that, and actually quite elegant.
Traditional Server-Push maintains a reference to a client object broker (OK fine. I am an old CORBA guy, lets call it a browser <wink>). As client register for events the server maintains a list of clients interested in the delivery of said event. When the event occurs, the servant connects to each interested consumer and pushes the data to them. While at the outset this seems simple enough, in a truly distributed network environment there are serious issues with this implementation and with the quality of service it can provide. First off, this design makes a somewhat crazy assumption that client are able and willing to accept inbound data transmission. Not only does it assume the "client/consumer" can handle this, it also assumes that the network allows it. Thats where this all falls apart in a hurry. How many network admins allow random inbound sockets? <smile>. This might work OK in an intranet app, but it is wholely unsuited for wide networks. Lets assume that show stopper didnt exist. Now we enter into a pretty serious quality of service issue. See architecturally we have a consumer who is extreemly interested in the delivery of an event. We also have a producer who owns the onus of delivering that event. Whenever you have two parties with concerns that disperate you are asking for issues. For instance. We all know how dependable our networks are right? sarcasm intended>. Lets say the servant has a list of clients to deliver an event to. Now it rolls through its list of clients, but client37 is unreachable. How long does the servant try to deliver the event? Eventually for perfomance reasons it needs to give up. But lo and behold, moments after giving up on client37 his network issue resolves itself. Guess what. Client37 has no idea that an event got delivered and that event is gone. Client37 will, like a dumbo sit there forever thinking maybe... just maybe that event will show up. Flex is about building enterprise apps. These kind of QoS issues simply arent acceptable. The blocking registration pattern solves both issues. All sockets are outbound (I know you think this is hijacking HTTP but again, how many *corporate* firewalls allow even outbound sockets besides HTTP on 80 and 443) so we have no firewall issues. Since the client has opened the socket, if the network drops, so does that socket. So does then marshalling back from the servant. This means there is no undue load on the servant. It also means when the network returns the client simply opens a socket back and boom, gets the event. Basically if coded correctly in your servant, you have nearly guaranteed delivery. You also now accomplish this with no polling, so no network overhead, and if wanted for performance, the servant can timeout http sockets itself. Now the consumer simply has his http call in a loop, and connects back. It can be quite elegant. You may not realize it because the vendors hide it behind API's, but nearly every enterprise message bus out there implements "push" as a blocking client pull. Someone asked earlier about performance issues. I think this rant is long enough. I'll go there and answer them. Dave Wolf Cynergy Systems, Inc. Macromedia Flex Alliance Partner http://www.cynergysystems.com Email: [EMAIL PROTECTED] Office: 866-CYNERGY x85 --- In [email protected], "Mink, Joseph" <[EMAIL PROTECTED]> wrote: > > I do realize that many people use this solution for asynchronous data > push from http servers, but it seems like a hack and an unintended use > of HTTP. However, while it may leave a bad taste in my mouth, I never > discredit something that works!!! > > It looks like we may be taking it a step further and might implement it > with the WebService object rather than the HTTPService object : ) > Assuming that there is no timeout implemented there either (in Flex), > then I assume it will work as well. > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Dave Wolf > Sent: Saturday, October 08, 2005 12:54 AM > To: [email protected] > Subject: [flexcoders] Re: HTTPService timeout > > > This is a very elegant way to handle server-push. It solves a myriad > of issues that "true" server-push has. It is more scalable, has > better quality of service, etc. > > You just need a servlet programmer who knows how to write thread safe > code. Do note that each client will then tie up an HTTP thread, so > you may need to allocate more in your server. > > -- > Dave Wolf > Cynergy Systems, Inc. > Macromedia Flex Alliance Partner > http://www.cynergysystems.com > > Email: [EMAIL PROTECTED] > Office: 866-CYNERGY x85 > > --- In [email protected], "Mink, Joseph" <[EMAIL PROTECTED]> > wrote: > > > > Thanks for the response, Matt...that's actually a good thing in the > way > > that I'll be planning to use HTTPService : ) > > > > Joey > > > > > > ________________________________ > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > On > > Behalf Of Matt Chotin > > Sent: Friday, October 07, 2005 10:45 AM > > To: [email protected] > > Subject: RE: [flexcoders] HTTPService timeout > > > > > > > > Currently HTTPService doesn't support a timeout on its own. You'll > need > > to use your own mechanism with setInterval. > > > > > > > > Matt > > > > > > > > ________________________________ > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > On > > Behalf Of Mink, Joseph > > Sent: Friday, October 07, 2005 5:03 AM > > To: [email protected] > > Subject: [flexcoders] HTTPService timeout > > > > > > > > Hi, > > > > > > > > I was wondering...does anyone know where/how to set the timeout for > > HTTPService requests? I am shamefully considering this as a solution > to > > asynchronous data push from the server...write a servlet that doesn't > > respond to requests until data of interest comes to be. > > > > > > > > Thanks! > > > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > > SPONSORED LINKS > Web site design development > <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+ > site+design+development&w2=Computer+software+development&w3=Software+des > ign+and+development&w4=Macromedia+flex&w5=Software+development+best+prac > tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ> Computer software > development > <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=We > b+site+design+development&w2=Computer+software+development&w3=Software+d > esign+and+development&w4=Macromedia+flex&w5=Software+development+best+pr > actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw> Software design and > development > <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1= > Web+site+design+development&w2=Computer+software+development&w3=Software > +design+and+development&w4=Macromedia+flex&w5=Software+development+best+ > practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ> > Macromedia flex > <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+ > development&w2=Computer+software+development&w3=Software+design+and+deve > lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=1 > 66&.sig=OO6nPIrz7_EpZI36cYzBjw> Software development best > practice > <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice& > w1=Web+site+design+development&w2=Computer+software+development&w3=Softw > are+design+and+development&w4=Macromedia+flex&w5=Software+development+be > st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw> > > ________________________________ > > YAHOO! GROUPS LINKS > > > > * Visit your group "flexcoders > <http://groups.yahoo.com/group/flexcoders> " on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/> . > > > ________________________________ > ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

