前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP Fiori OData取数据的同步模式和异步模式比较

SAP Fiori OData取数据的同步模式和异步模式比较

作者头像
Jerry Wang
发布2020-08-12 10:35:42
4820
发布2020-08-12 10:35:42
举报

Yesterday I was challenged by my colleague: in the CRM Fiori application “My Opportunity”, although the OData request for logo url is set as false ( means Synchronous ), why we still observe in UI that this request is done like Asynchronously?

For the complete story about Image display logic in Fiori, please refer to this blog: CRM Fiori Application – how is image maintained and displayed in Fiori UI.

My colleague’s doubt is that he observed even the response of image url is not returned by backend, still end user could continue to work on UI – it seems UI is not blocked so my colleague considered that the request is done in an Asynchronous way.

I just would like to share with you how I persuade him to accept this is really an Synchronous request.

The key idea here is: We are doing test in our internal system, the request for image url is almost immediately returned ( less than 2 seconds ), so it is really difficult to judge by eye whether it is synchronous or asynchronous.

As a result, I add another 13 seconds’ latency in OData service implementation:

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.

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. Any OData request with async set as false, would and must be done synchronously.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-08-11 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Synchronous mode
  • Asynchronous mode
  • Conclusion
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档