more refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-23 03:07:41 +03:00
parent 5253cef665
commit e864249603
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "4.0.0",
"version": "4.1.0",
"description": "Generic JavaScript types and type extensions...",
"main": "main.js",
"scripts": {

View File

@ -40,7 +40,7 @@ module.STOP = object.STOP
var Queue =
module.Queue = object.Constructor('Queue', Array, {
// create a running queue...
run: function(...tasks){
runTasks: function(...tasks){
return this({ state: 'running' }, ...tasks) },
}, events.EventMixin('flat', {
@ -131,7 +131,7 @@ module.Queue = object.Constructor('Queue', Array, {
task()
: (task instanceof Queue
&& this.sub_queue == 'unwind') ?
(task.run(next), task)
(task.runTask(next), task)
: (task instanceof Queue
&& this.sub_queue == 'wait') ?
task.start()
@ -156,7 +156,7 @@ module.Queue = object.Constructor('Queue', Array, {
while(this.length > 0
&& this.state == 'running'
&& (this.__running || []).length < (this.pool_size || Infinity) ){
this.run(this.__run_tasks__.bind(this)) }
this.runTask(this.__run_tasks__.bind(this)) }
// empty queue -> pole or stop...
//
@ -184,7 +184,7 @@ module.Queue = object.Constructor('Queue', Array, {
// run one task from queue...
//
// NOTE: this does not care about .state...
run: function(next){
runTask: function(next){
var running = this.__running = this.__running || []
// can't run...