Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 926 Bytes

File metadata and controls

62 lines (40 loc) · 926 Bytes

FSLock API

const opts = {
      autoexec: true
}
const queue = new FSLock(opts);

Options :

  • autoexec : (default : true) - When true, will automatically execute .start()

add(command, path, params)

    const job = queue.add('Directory.create','./myfolder');

get([index = 0]) {

Will get the next job

  • index : (default:0) - Specify the index to get
    const job = queue.get()

async processAll()

Will process all next job except if stopped during processing

   await queue.processAll();

processNext([index=0]) {

Will process next job only.

  • index : (default:0) - Specify the number of job to skip.
   await queue.processNext();

start

Allow to start processing all in continuous

    queue.start()

stop

Allow to stop all process, including processing all at it's next tick

    queue.stop();