GetConn returns a connection from the goworker Redis connection pool. When using the pool, check in connections as quickly as possible, because holding a connection will cause concurrent worker functions to lock while they wait for an available connection. Expect this API to change drastically.
()
| 73 | // while they wait for an available connection. Expect this |
| 74 | // API to change drastically. |
| 75 | func GetConn() (*RedisConn, error) { |
| 76 | resource, err := pool.Get(ctx) |
| 77 | |
| 78 | if err != nil { |
| 79 | return nil, err |
| 80 | } |
| 81 | return resource.(*RedisConn), nil |
| 82 | } |
| 83 | |
| 84 | // PutConn puts a connection back into the connection pool. |
| 85 | // Run this as soon as you finish using a connection that |