An open API service indexing awesome lists of open source software.

https://github.com/bitcoin-api/bqe

NodeJS Background Executor Function
https://github.com/bitcoin-api/bqe

Last synced: 8 months ago
JSON representation

NodeJS Background Executor Function

Awesome Lists containing this project

README

          

# bqe

[![npm version](https://badge.fury.io/js/bqe.svg)](https://badge.fury.io/js/bqe)

bqe - Background Queue Executor

## About

Execute asynchronous operations in sequence in the background

## Example

When your code starts up:

```.js
'use strict';

const bqe = require( 'bqe' );

bqe.start();
```

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

```.js
'use strict';

const bqe = require( 'bqe' );

bqe.addOperation({

operation: async () => {

await new Promise( resolve => {

setTimeout( () => {

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

resolve();

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