Skip to content

Should Agent could expose "clients" property? #1996

Answered by ronag
StefanCenusa asked this question in Q&A
Discussion options

You must be logged in to vote
class MyPool extends Pool {
  #full = false
  constructor () {
    super()
    this.on('drain', () => { this.#full = false })
  }
   dispatch(...args) {
     const ret = super.dispatch(...args)
     this.#full = !ret
     return ret
   }
}
const dispatcher = new MyPool()
undici.request(url, { dispatcher })

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ronag
Comment options

@StefanCenusa
Comment options

@StefanCenusa
Comment options

@ronag
Comment options

Comment options

You must be logged in to vote
1 reply
@StefanCenusa
Comment options

Answer selected by StefanCenusa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants