MCPcopy
hub / github.com/redis/go-redis / chain

Method chain

redis.go:143–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143func (hs *hooksMixin) chain() {
144 hs.initial.setDefaults()
145
146 hs.hooksMu.Lock()
147 defer hs.hooksMu.Unlock()
148
149 hs.current.dial = hs.initial.dial
150 hs.current.process = hs.initial.process
151 hs.current.pipeline = hs.initial.pipeline
152 hs.current.txPipeline = hs.initial.txPipeline
153
154 for i := len(hs.slice) - 1; i >= 0; i-- {
155 if wrapped := hs.slice[i].DialHook(hs.current.dial); wrapped != nil {
156 hs.current.dial = wrapped
157 }
158 if wrapped := hs.slice[i].ProcessHook(hs.current.process); wrapped != nil {
159 hs.current.process = wrapped
160 }
161 if wrapped := hs.slice[i].ProcessPipelineHook(hs.current.pipeline); wrapped != nil {
162 hs.current.pipeline = wrapped
163 }
164 if wrapped := hs.slice[i].ProcessPipelineHook(hs.current.txPipeline); wrapped != nil {
165 hs.current.txPipeline = wrapped
166 }
167 }
168}
169
170func (hs *hooksMixin) clone() hooksMixin {
171 hs.hooksMu.Lock()

Callers 2

initHooksMethod · 0.95
AddHookMethod · 0.95

Calls 4

setDefaultsMethod · 0.80
DialHookMethod · 0.65
ProcessHookMethod · 0.65
ProcessPipelineHookMethod · 0.65

Tested by

no test coverage detected