@@ -81,8 +81,7 @@ type hooks struct {
81
81
82
82
// AddHook is to add a hook to the queue.
83
83
// Hook is a function executed during network connection, command execution, and pipeline,
84
- // it is a first-in-last-out stack queue (FILO).
85
- // The first to be added to the queue is the execution function of the redis command (the last to be executed).
84
+ // it is a first-in-first-out stack queue (FIFO).
86
85
// You need to execute the next hook in each hook, unless you want to terminate the execution of the command.
87
86
// For example, you added hook-1, hook-2:
88
87
//
@@ -112,10 +111,10 @@ type hooks struct {
112
111
//
113
112
// The execution sequence is:
114
113
//
115
- // hook-2 start -> hook-1 start -> exec redis cmd -> hook-1 end -> hook-2 end
114
+ // hook-1 start -> hook-2 start -> exec redis cmd -> hook-2 end -> hook-1 end
116
115
//
117
116
// Please note: "next(ctx, cmd)" is very important, it will call the next hook,
118
- // if "next(ctx, cmd)" is not executed in hook-1 , the redis command will not be executed.
117
+ // if "next(ctx, cmd)" is not executed, the redis command will not be executed.
119
118
func (hs * hooks ) AddHook (hook Hook ) {
120
119
hs .slice = append (hs .slice , hook )
121
120
hs .chain ()
0 commit comments