(addr string, database int, config *Config)
| 42 | } |
| 43 | |
| 44 | func NewBackendConn(addr string, database int, config *Config) *BackendConn { |
| 45 | bc := &BackendConn{ |
| 46 | addr: addr, config: config, database: database, |
| 47 | } |
| 48 | bc.input = make(chan *Request, 1024) |
| 49 | bc.retry.delay = &DelayExp2{ |
| 50 | Min: 50, Max: 5000, |
| 51 | Unit: time.Millisecond, |
| 52 | } |
| 53 | |
| 54 | go bc.run() |
| 55 | |
| 56 | return bc |
| 57 | } |
| 58 | |
| 59 | func (bc *BackendConn) Addr() string { |
| 60 | return bc.addr |