parent
65458b2de2
commit
bf356e79fc
7 changed files with 8 additions and 8 deletions
|
@ -118,14 +118,14 @@ func (t *Transport) cleanup(all bool) {
|
|||
}
|
||||
}
|
||||
|
||||
// It is hard to pin a value to this, the import thing is to no block forever, loosing at cached connection is not terrible.
|
||||
// It is hard to pin a value to this, the import thing is to no block forever, losing at cached connection is not terrible.
|
||||
const yieldTimeout = 25 * time.Millisecond
|
||||
|
||||
// Yield return the connection to transport for reuse.
|
||||
func (t *Transport) Yield(pc *persistConn) {
|
||||
pc.used = time.Now() // update used time
|
||||
|
||||
// Make ths non-blocking, because in the case of a very busy forwarder we will *block* on this yield. This
|
||||
// Make this non-blocking, because in the case of a very busy forwarder we will *block* on this yield. This
|
||||
// blocks the outer go-routine and stuff will just pile up. We timeout when the send fails to as returning
|
||||
// these connection is an optimization anyway.
|
||||
select {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue