async/await

This commit is contained in:
vss-devel 2019-03-04 17:16:35 +03:00
parent ff601c9037
commit 6543da4196

View File

@ -319,8 +319,8 @@ class Writer {
this.queue = genericPool.createPool( this.queue = genericPool.createPool(
{ {
create () { return Promise.resolve( Symbol() ) }, async create () { return Symbol() },
destroy ( resource ) { return Promise.resolve() }, async destroy ( resource ) { return true },
}, },
{} {}
) )
@ -434,8 +434,8 @@ class ClusterPool {
this.savePrefix = outPath + '.tmp' this.savePrefix = outPath + '.tmp'
this.pool = genericPool.createPool( this.pool = genericPool.createPool(
{ {
create () { return Promise.resolve( Symbol() ) }, async create () { return Symbol() },
destroy ( resource ) { return Promise.resolve() }, async destroy ( resource ) { return true },
}, },
{ max: 8, } { max: 8, }
) )
@ -594,10 +594,10 @@ class Item {
return mimeTypeIndex( this.mimeType ) return mimeTypeIndex( this.mimeType )
} }
getId () { async getId () {
if ( ! this.id ) if ( ! this.id )
this.id = this.saveItemIndex() this.id = this.saveItemIndex()
return Promise.resolve( this.id ) return await this.id
} }
async saveItemIndex () { async saveItemIndex () {
@ -826,8 +826,8 @@ class DataItem extends Item {
Object.assign( this, { clusterIdx, blobIdx }) Object.assign( this, { clusterIdx, blobIdx })
} }
getData () { async getData () {
return Promise.resolve( this.data ) return await this.data
} }
storeDirEntry () { storeDirEntry () {