@Fox спасибо, немного помогли твои светы, но пока только получается сделать чтобы они все разом открывались и возвращали результат, я не заню как ограничить кол-во одновременно работающиех потоков.
Моего опыта в программировании не хватает такое реализовать. Подскажи пожалуйста, как сделать такое. Я думаю многим кто сталкнется с этим, было бы интересно знать

$(document).ready(function () {
var app = new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
value: `Татьяна,Орлова,ж
Галина,Замятина,ж
Максим,Федотов,ж
Сергей,Ковальчук,м
Вера,Алферова,ж
Салават,Нурмухаметов,м
Лариса,Малахова,ж
Екатерина,Худякова,ж
Евгения,Отт,ж
Аида,Хаирова,ж
Ахтар,Баймурзин,м
Гульнара,Иванова,ж`
},
methods: {
async restartScript() {
Api.Restart()
},
async getValueTextArea() {
let regEx = /[^\r\n]+/g;
let nameList = this.value.match(regEx)
for (i = 0; i < nameList.length; i++) {
Api.RunFunction('test', { user: nameList[i] })
}
var RunningTasks = Api.GetTasks()
console.log(RunningTasks)
Object.values(RunningTasks).forEach(function (Task) {
console.log(Task)
Task.object.then((data) => console.log('return', data));
})
}
}
})
/////Api event handler
Api.SetEventHandler(function (EventType, EventData) {
/////Script started
if (EventType == "start") {
}
/////Script stopped
if (EventType == "stop") {
}
/////More events: https://wiki.bablosoft.com/web-interface/#/managingscriptlifetime
})
/////Automatically start script https://wiki.bablosoft.com/web-interface/#/managingscriptlifetime?id=method-acceptresources
Api.AcceptResources(true)
/////After everything is initialized may show body
$("body").fadeIn()
/////Events
});
/////Resource values are obtained through this function when hitting run button, you can change it.
/////For example, you can edit value entered by user, make custom validation, or replace resource system compleatelly
/////More info: https://wiki.bablosoft.com/web-interface/#/managingscriptlifetime?id=method-acceptresources
function GetResourceValue(ResourceName) {
return ""
}
//Interface editor has no connection to BAS and therefore can't execute BAS functions.
//If you try to call function from interface editor,
//you will get a random string as result in a several seconds.
//This behavior is not acceptable in several cases: if your function return a list,
//not a string, or string in specific format, if you want to test error handling, etc.
//In order to circumvent this limitation. you need to define "EmulateFunctionRun"
//function inside web interface.
//More info: https://wiki.bablosoft.com/web-interface/#/callbasfunction?id=debugging-bas-function-call
function EmulateFunctionRun(FunctionName, FunctionParameters, Resolve, Reject) {
//Generate random data
var RandomTime = Math.floor(Math.random() * (5000 - 3000)) + 3000
var RandomResult = Math.floor(Math.random() * (1000))
//Return result in RandomTime milliseconds
setTimeout(function () {
//Generate result string
Resolve("Test result " + RandomResult)
}, RandomTime)
}