Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Add timeout to Provider Actions

  1. #1
    Sencha User
    Join Date
    Sep 2007
    Location
    Tulsa, Oklahoma
    Posts
    178

    Question Add timeout to Provider Actions

    It would be nice to be able to set a unique timeout value for each provider actions. Sometimes there might be a delay from the server side due to a lengthy process. Other times you might want to generate an exception if the return is not fast enough.

    I have used Ext.Ajax.timeout to get around things, but I think it would be better to have the ability to set this per provider actions rather than changing Ext.Ajax.timeout.

    Thoughts?
    Thanks!
    Chuck

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    A timeout parameter has since been added to the provider itself.

    I like the idea of having a timeout on specific actions, however you will encounter a problem when using buffering.

    Let's say I've specified a timeout on A of 5s and a timeout of 6s on B.

    What happens when I queue A & B within a buffered transaction?

    In that case the only way you could get around that is to send seperate requests for action groups, which isn't really desireable and kind of defeats the purpose of buffering in the first place.

    What do people think?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3

    Default

    Just give an example for ppls to think about it:

    In one of my panel, it contains several portlets (panel), each panel owns a dataview and store. That means 10 panels will make 10 AJAX requests to the server.

    I'd want to separate these 10 requests into 2 groups, as a result each group has 5 requests.

    Why I'm doing that?
    If I make 10 requests into 1 batch (by setting the buffer size of remotingProvider), all the portlet's results will be held until all 10 requests got the response from server.

    However, I don't want to set the buffersize to 0, which means 10 request will consume 10 individual AJAX requests. It waste a lot of bandwidth (the http header part).

    So this is our scenario.

    And till now I can't find a way to do that...

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    I think you're mistaking the purpose of the buffer.

    The buffer is the amount of ms to wait before sending off a series of requests, not the number of requests to send.

    The purpose of the timeout parameter is to indicate how long to wait before the request succeeds/fails.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5

    Default

    Quote Originally Posted by evant View Post
    I think you're mistaking the purpose of the buffer.

    The buffer is the amount of ms to wait before sending off a series of requests, not the number of requests to send.

    The purpose of the timeout parameter is to indicate how long to wait before the request succeeds/fails.

    I understand what the buffer doing, my problem is I cannot manually group the requests.

    Since I can't control the ms of each request to be sent out, how do I manage or give them a priority?

    Anyway, please suggest some solutions to solve my case, if possible.
    thanks

  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    How do you want to group them? What kind of logic would you use? if the buffer is defaulting to 10ms, does it really matter?

    Would you want to be able to group all requests by action?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  7. #7

    Default

    As mentioned above:

    In one of my panel, it contains several portlets (panel), each panel owns a dataview and store. That means 10 panels will make 10 AJAX requests to the server.

    I'd want to separate these 10 requests into 2 groups, as a result each group has 5 requests.

    Why I'm doing that?
    If I make 10 requests into 1 batch (by setting the buffer size of remotingProvider), all the portlet's results will be held until all 10 requests got the response from server.

    However, I don't want to set the buffersize to 0, which means 10 request will consume 10 individual AJAX requests. It waste a lot of bandwidth (the http header part).

    So this is our scenario.

  8. #8
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Yes, I understand, but practically, how would it work?

    What is your criteria for grouping? When you send off the call, how do you specify it should be part of a particular group? Or how do you indicate to the provider that a particular action should belong to that group?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  9. #9

    Default

    Quote Originally Posted by evant View Post
    Yes, I understand, but practically, how would it work?

    What is your criteria for grouping? When you send off the call, how do you specify it should be part of a particular group? Or how do you indicate to the provider that a particular action should belong to that group?
    Basically, you can imagine that a Panel on a page, with left and right region.

    For each region, it contains 5 portlets (let say they are gridpanel).

    So, in order to separate the loading dependency of 2 regions, while we don't want to make 10 individual requests.

    As a result we decided to group 10 requests into 2 separate groups.

  10. #10
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Then, perhaps the solution is a "batchgroup" option we could add, which would allow you to specify different buffers/timeouts for different groups.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •