天天看點

關于Fiori application裡取Account image的Odata request是否會阻塞UI的問題讨論

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.

關于Fiori application裡取Account image的Odata request是否會阻塞UI的問題讨論

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.

關于Fiori application裡取Account image的Odata request是否會阻塞UI的問題讨論

繼續閱讀