rethinkdb / rethinkdb-ts

RethinkDB TypeScript driver
Apache License 2.0
123 stars 17 forks source link

queueing event #115

Open ptorrent opened 1 year ago

ptorrent commented 1 year ago

Hell there,

Regarding rethinkdbdash, there is the

queueing: when a query is added/removed from the queue (queries waiting for a connection), the size of the queue is provided

I receive the "queueing" event on the pool but the value is always undefined !

pool.on('queueing', x => console.log(x))

always give me undefined.

Is that normal ?

ptorrent commented 1 year ago

Is that correct ?

this.emit('queueing',this.getPoolNumOfRunningQueries());
....
getPoolNumOfRunningQueries() {
    return this.getHealthyServerPools().reduce((a, next) => a + next.getNumOfRunningQueries(),0);
}

in master-pool.js

atassis commented 1 year ago

There is no argument provided in the code now for that event, but I see no issue in using the public method to retrieve it from method.