I actually agree with you.  Having a synchronous call would make life
so much easier in many places.  Yes, there are always ways to code
around it.  But, if I have a situation where I don't want the user to
do anything else, or any more logic to be run until I get the answer
back from the server, then it would be very nice if I could simply set
a flag for synchronous, make the call, wait for it to time out/error
out, then move on.  This kind of stuff comes up all the time and I
don't like having to add more lines of code and functions to code
around this.

But, I also agree that the default behavior should be async as in my
experience the majority of calls I want to be async.

Basically, it would be nice if the tool/language/etc. gave us, the
developer, the choice on which is the best way to implement rather
than forcing it.

I also realize that the main reason we don't have the option is
because it is not an easy thing to do.

Just my 2 cents,

Dale


--- In flexcoders@yahoogroups.com, "byte.sensei" <[EMAIL PROTECTED]> wrote:
>
> Thanks for the replies.  This is (sort of) the direction I was headed, 
> although I like your specific idea below.  I guess I'm still holding on 
> to the synchronous world of coding I came from. ;)  I feel like I'm 
> always having to come up with ways to deal with Flex's asynchronous 
> behavior, and it seems to require alot of additional code/handling (in 
> my opinion).  
> 
> Anyway, thanks for the specific "counter" idea below -- I'll give it a 
> shot!
> 
> 
> --- In flexcoders@yahoogroups.com, "jerusalem_pilgrim" 
> <elephantium@> wrote:
> >
> > Why can't you just use a "web service calls" counter in your code? 
> > Every time a request goes out, increment it, every time you get a
> > response, decrement it.  The "Print Receipt" button only gets enabled
> > if the counter is back to 0.
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "byte.sensei" <byte.sensei@> wrote:
> > > data to produce a PDF receipt.  The problem is, if a user 
> clicks "Print 
> > > Receipt" before all the save order web services have finished, then 
> > > they only get a partial receipt.  There's also not an easy way to 
> > > determine if all the web service calls are finished, so I can't 
> > > disable/enable the button based on that.
> >
>


Reply via email to