bqe

Execute asynchronous operations in sequence in the background

Usage no npm install needed!

<script type="module">
  import bqe from 'https://cdn.skypack.dev/bqe';
</script>

README

bqe

npm version

bqe - Background Queue Executor

About

Execute asynchronous operations in sequence in the background

Example

When your code starts up:

'use strict';

const bqe = require( 'bqe' );


bqe.start();

When you want to add an operation to the background execution queue:

'use strict';

const bqe = require( 'bqe' );


bqe.addOperation({

    operation: async () => {

        await new Promise( resolve => {

            setTimeout( () => {

                console.log( 'operation in background log' );

                resolve();

            }, 1000 );
        });
    }
});