All files queue.js

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18      3x 3x         1x         2x      
// A queue that filters messages in the exchange
export class Queue {
    constructor(exchange, filterFunc) {
        this.exchange = exchange;
        this.filterFunc = filterFunc;
    }
 
    // Returns the full ReQL query for this queue
    fullQuery() {
        return this.exchange.fullQuery(this.filterFunc);
    }
 
    // Subscribe to messages from this queue's subscriptions
    subscribe(iterFunc) {
        return this.exchange.subscribe(this.filterFunc, iterFunc);
    }
}