MCPcopy
hub / github.com/benmanns/goworker / GetConn

Function GetConn

goworker.go:75–82  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

73// while they wait for an available connection. Expect this
74// API to change drastically.
75func 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

Callers 4

EnqueueFunction · 0.85
pollMethod · 0.85
workMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected