When I am doing a test of comparison between Stateful and Stateless BSP application ( mentioned in blog Stateless and Stateful – Different behavior in application side ), I meet with a strange issue. The conclusion is stateful BSP application will handle request sequentially. Suppose in client I send two request A and B to server. Request A takes 3 seconds to finish and B 2 seconds. The request is sent via jQuery API. (1) the start time of both request are almost the same, since I send out two request in client code almost at the same time. The above test did verify the conclusion. the testing request for stateful application looks as below this time: The two requests are handled simultaneously ( request B only takes 2 seconds to finish, no 3 seconds’ wait time for A to finish this time ), the response of second request returns first before the first, which could be observed in console: why the latest ES6 API causes such discrepancy with known conclusion? Through comparison I get to know that the session cookie After this change the stateful BSP application behaves as expected: the requests are handled in sequence. 要获取更多Jerry的原创文章,请关注公众号"汪子熙": |
|
来自: 汪子熙 > 《JavaScript》