Comparing version 1.3.2 to 1.4.0
@@ -63,4 +63,12 @@ const | ||
} | ||
close() { | ||
return this.queue.close(); | ||
} | ||
get closed() { | ||
return this.queue.closed; | ||
} | ||
} | ||
module.exports = FileQueue; |
@@ -93,2 +93,6 @@ const | ||
get closed() { | ||
return this.db.isClosed(); | ||
} | ||
async lock(callback) { | ||
@@ -103,2 +107,8 @@ await this.mutex.take(); | ||
close() { | ||
return new Promise((ok,rej)=>{ | ||
this.db.close(err=>err?rej(err):ok()); | ||
}); | ||
} | ||
async push(data,callback) { | ||
@@ -105,0 +115,0 @@ try { |
{ | ||
"name": "fileq", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "File based FIFO queue", | ||
@@ -5,0 +5,0 @@ "author": "David Gómez Matarrodona <solzimer@gmail.com>", |
@@ -164,5 +164,11 @@ # fileq | ||
### queue.close() => Promise | ||
Closes de queue | ||
### queue.locked => Boolean | ||
Returns *true* if queue has a virtual lock; *false* otherwise. | ||
### queue.closed => Boolean | ||
Returns *true* if the queue has been closed | ||
## Options | ||
@@ -169,0 +175,0 @@ When creating a queue, data are stored in several files in a folder. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19650
480
183