(conf *PoolConfig, maxSize, connectionTimeoutInMs, waitToGetSessionTimeoutInMs int, enableCompression bool, sqlDialect string)
| 59 | } |
| 60 | |
| 61 | func newSessionPoolWithSqlDialect(conf *PoolConfig, maxSize, connectionTimeoutInMs, waitToGetSessionTimeoutInMs int, |
| 62 | enableCompression bool, sqlDialect string) SessionPool { |
| 63 | conf.sqlDialect = sqlDialect |
| 64 | if maxSize <= 0 { |
| 65 | maxSize = runtime.NumCPU() * defaultMultiple |
| 66 | } |
| 67 | var ch = make(chan Session, maxSize) |
| 68 | var sem = make(chan int8, maxSize) |
| 69 | return SessionPool{ |
| 70 | config: conf, |
| 71 | maxSize: maxSize, |
| 72 | waitToGetSessionTimeoutInMs: waitToGetSessionTimeoutInMs, |
| 73 | connectionTimeoutInMs: connectionTimeoutInMs, |
| 74 | enableCompression: enableCompression, |
| 75 | ch: ch, |
| 76 | sem: sem, |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func (spool *SessionPool) GetSession() (session Session, err error) { |
| 81 | for { |
no outgoing calls
no test coverage detected
searching dependent graphs…