How to use the fastpriorityqueue.ts.FastPriorityQueue function in fastpriorityqueue

To help you get started, we’ve selected a few fastpriorityqueue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github devalpha-io / devalpha-node / dist / util / streams.js View on Github external
function createSortedStream(feeds) {
    const streams = createStreams(feeds);
    // eslint-disable-next-line no-unused-vars
    const heap = new fastpriorityqueue_ts_1.FastPriorityQueue((t1, t2) => {
        if (typeof t1 === 'undefined') {
            if (typeof t2 === 'undefined') {
                return false;
            }
            return true;
        }
        if (typeof t1 === 'undefined') {
            return false;
        }
        return t1 < t2;
    });
    Object.keys(streams).forEach((type) => {
        const stream = streams[type];
        stream.pull((err, item) => {
            if (!err && item) {
                heap.add({

fastpriorityqueue

Fast heap-based priority queue in JavaScript

Apache-2.0
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis