关于Fiori application里取Account image的Odata request是否会阻塞UI的问题讨论
Question
From: Wang, Jerry
Sent: Friday, 19 June, 2015 4:31 PM
Subject: RE: [Follow up] Why the synchronous request did not BLOCK the UI
Hi all,
這個issue很有意思,昨天和德國同事開會時,他們問我們為什么我們code里寫的odata request是同步的,但是并沒有block 住UI。當時我沒答上來,因為確實我看起來也是沒block UI。
今天我做了研究,通過圖表和視頻 理直氣壯地告訴他們:代碼沒問題,是我們眼睛犯錯了。視頻在下面的share folder里。研究思路在下面的郵件里。
Please read more detail from Jerry’s mail.
Jerry’s analysis process
手動在后臺reques響應里加上一個延時,來模擬后臺耗時很長的scenario.
Then I test in UI with this modified Odata implementation. Now as expected it took around 13 seconds to get the returned image url.
During this timeframe, UI is completely freezed: end user does not have any chances to click anything in UI.
Synchronous mode
Afterwards the synchronous behavior is quite obvious now. I click one item in navigation list to trigger the synchronous request for Image url retrieval. And after that, I cannot do any operation on UI - it is completely freezed.
Please refer to attached video “synchronous.wmv”.
Asynchronous mode
Then I change the manual latency to 20 seconds and retest the UI.
Now every time I click one opportunity in the navigation list, still one http request for image logo is sent out. Compared with synchronous mode, this time the UI is not blocked - I can continue to work on UI without waiting for the response.
This asynchronous behavior could also easily be found in the timechart in Chrome network:
Conclusion
code is correct, our eye is wrong.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":總結
以上是生活随笔為你收集整理的关于Fiori application里取Account image的Odata request是否会阻塞UI的问题讨论的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原神小姜位置在哪
- 下一篇: 怎样检测苹果手机是否弯曲(《怎样》歌词)