最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - How to handle queued execution indicators on SPA side? - Stack Overflow

programmeradmin4浏览0评论

File upload process end up with file being uploaded to some kind of a cloud storage. Once upload is done, there is an automated queuing process that queues the file for processing. This queued state takes some time until file gets processed. Once processing starts, there will be a record in db with the status.

Question is, how to handle indicator on SPA side before record hits the db?

Client SPA application should somehow indicate that there is a file to be processed but since there is no record in db yet, it has no source it can read the actual status from.

Only thing I can think of is saving it in local storage with some client generated guid and compare by that guid once it hits db. But, I don't like it since its:

  1. Doesn't work cross devices
  2. Involves assumptions for how long can/should something be in that state before discarded from local storage (if background process never picks up and writes to db)
发布评论

评论列表(0)

  1. 暂无评论