Critical issue: cote does not respond to sequential queries with delay
See original GitHub issueHello. I ran into the following issue: when I send query to same responder with some delay (say, 2 second), only first query get response. Here is code:
import cote from 'cote'
const delay = (msecs: number) => new Promise((resolve: () => void) => setTimeout(resolve, msecs))
const onResponse = (err: any, res: any) => {
console.log('result:', res)
console.log('error:', err)
}
const responder = new cote.Responder({ name: 'auth' })
responder.on('request', (req: any, cb: any) => {
console.log('received request: ', req)
cb(null, 'response')
})
async function main() {
const requester = new cote.Requester({ name: 'req' })
requester.send({ type: 'request', data: 'fooBar' }, onResponse)
await delay(2000)
requester.send({ type: 'request', data: 'fooBar' }, onResponse)
await delay(2000)
requester.send({ type: 'request', data: 'fooBar' }, onResponse)
}
main()
Only first query gets response using the code above.
OS: Windows 10 Node: v12.2.0 Cote: 0.20.0
I also tried to turn off windows firewall, no effect.
UPD1: I tried to launch time service example (from top of cote documentation), and if I launch time client.js repeatedly, I get answer only for first time after time_service.js start
UPD2: I noticed that example above will work if I will stop few other cote services. They have nothing common with example above, not a service name nor query type.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
PostgreSQL-based application performance: latency ... - EDB
Every time your application runs a query it has to wait for the server to respond with success/failure and possibly a result set, ......
Read more >6. Measurement Synchronization | Rohde & Schwarz
Therefore, the Idle periods in your program are taking place in VISA Read operations where your program waits for the instrument to respond...
Read more >4 stages of major incident management process & RACI matrix
If a problem is created in response to the major incident, the problem manager owns the problem ticket. The problem manager tries to...
Read more >Network Latency - Common Causes and Best Solutions | IR
The way we work is changing exponentially thanks to advancing technology, ... and longer delays are called a high-latency network (not so desirable)....
Read more >Evaluation and management of suspected sepsis and septic ...
In this topic review, the management of sepsis and septic shock is ... However, the insertion of a central line should not delay...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I updated the README to reflect this nature.
@dashersw thanks a lot