This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
QSTAT only returns data once in a while #8
Comments
Hi, how do you use this command? There is no problem in my test. callback style:
generator style:
|
I am using the promise API. I am using the QSTAT command on 4 queues in sequence. The first run typically works without issue. However, subsequent calls often result in most or all of the responses coming back null. My script: disque = require 'thunk-disque'
cluster = [
'disque-0q:7711'
'disque-1q:7711'
'disque-2q:7711'
]
client = disque.createClient(cluster, {usePromise: true})
jsonify = (obj) -> JSON.stringify(obj, null, 2)
client.info()
.then (info) -> console.log "Info: #{jsonify info}"
.then -> client.hello()
.then (hello) -> console.log "Hello: #{jsonify hello}"
.then -> client.qstat 'queue-A'
.then (stats) -> console.log "'queue-A' stats:\n#{jsonify stats}"
.then -> client.qstat 'queue-B'
.then (stats) -> console.log "'queue-B' stats:\n#{jsonify stats}"
.then -> client.qstat 'queue-C'
.then (stats) -> console.log "'queue-C' stats:\n#{jsonify stats}"
.then -> client.qstat 'queue-D'
.then (stats) -> console.log "'queue-D' stats:\n#{jsonify stats}"
.then -> client.end()
.catch (error) ->
console.error "Error: #{error}\n#{error.stack}" Results:
|
You should add job to queue before
|
Good to know. I will do this moving forward. Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I run the QSTAT command it mostly returns
null
. However, every so often it will come back with the stats for the queue. I have found that a number of attempts in quick succession often result in the stats showing up eventually.Perhaps this has something to do with the client not waiting for the result of the QSTAT command, then receiving them on subsequent calls because the data becomes available later.
I am have configured the client with
usePromise
set to true. I am connected to a 3-node cluster, with each host on a separate IP.Please let me know if there is any additional detail I can provide.
The text was updated successfully, but these errors were encountered: