Jump to content

Async to Sync


Recommended Posts

As a classic old-fashion programmer , I learnt to develop with the procedural approach in mind.

I try to adapt into the web - asynchronous model , and in most cases I don't have any problem.


But , there are times that I want to block the program flow until some javascript function return a value.

Is there any possibility to achieve that?

Link to comment
Share on other sites

  • 2 weeks later...

I really do have a problem with that.

I have already used any method I know off without any success.


Could you please give me a hand?


All I want is to execute a javascript snippet on the server

and wait (block the program flow) until the response comes.

Link to comment
Share on other sites

Hi, Farshad.

Thank you for your reply.


OK , I (fully) understand that position.

I know , I must change my WIN32 programming style and start thinking as a web developer.


In the following post:


you wrote that you can add a mode which UI is blocked after each Ajax request.

Do we have any luck to see it in the near future??


If your events are synchronous the only way is to block UI until each event is fully processed. There is no other way. There is no way for framework to handle this situation internally. Of course, we can add a mode which UI is blocked after each Ajax request. This will reduce UI experience quality but you need it if your app is designed and works synchronously. If one event can't be executed more than once you need to protect it using client side UI masking techniques....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...