refactor read/write of structs

This commit is contained in:
Kevin Jahns
2019-04-07 23:08:08 +02:00
parent 90b3fa9dd9
commit 7a111de186
19 changed files with 418 additions and 304 deletions

View File

@@ -1,6 +1,6 @@
import {
Transaction, ID, ItemType, AbstractItem, AbstractStruct // eslint-disable-line
AbstractRef, ID, ItemType, AbstractItem, AbstractStruct // eslint-disable-line
} from '../internals.js'
import * as math from 'lib0/math.js'
@@ -14,6 +14,16 @@ export class StructStore {
* @type {Map<number,Array<AbstractStruct>>}
*/
this.clients = new Map()
/**
* Store uncompleted struct readers here
* @see tryResumePendingReaders
* @type {Set<{stack:Array<AbstractRef>,structReaders:Map<number,IterableIterator<AbstractRef>>,missing:ID}>}
*/
this.pendingStructReaders = new Set()
/**
* @type {Array<decoding.Decoder>}
*/
this.pendingDeleteReaders = []
}
}