Accessing IndexedDB from multiple javascript threads

前端 未结 3 1013
春和景丽
春和景丽 2021-02-03 09:56

Overview: I am trying to avoid a race condition with accessing an IndexedDB from both a webpage and a web-worker.

Setup: Webpage tha

3条回答
  •  名媛妹妹
    2021-02-03 10:38

    Old thread but the use of a transaction would solve the Failed Solution approach. I.e. the transaction only needs to span the check that the data in the IndexedDB hasn't change after the send and marking it as sent if there was no change. If there was a change, the transaction ends without writing.

提交回复
热议问题