@@ -96,23 +96,13 @@ class CommandId : public facade::CommandId {
96
96
command_stats_ = std::make_unique<CmdCallStats[]>(thread_count);
97
97
}
98
98
99
- using Handler =
100
- fu2::function_base<true /* owns*/ , true /* copyable*/ , fu2::capacity_default,
101
- false /* non-throwing*/ , false /* strong exceptions guarantees*/ ,
102
- void (CmdArgList, Transaction*, facade::SinkReplyBuilder*,
103
- ConnectionContext*) const >;
104
- using Handler2 =
105
- fu2::function_base<true , true , fu2::capacity_default, false , false ,
106
- void (CmdArgList, Transaction*, facade::SinkReplyBuilder*) const >;
107
-
108
99
using Handler3 = fu2::function_base<true , true , fu2::capacity_default, false , false ,
109
100
void (CmdArgList, const CommandContext&) const >;
110
101
using ArgValidator = fu2::function_base<true , true , fu2::capacity_default, false , false ,
111
102
std::optional<facade::ErrorReply>(CmdArgList) const >;
112
103
113
104
// Returns the invoke time in usec.
114
- uint64_t Invoke (CmdArgList args, Transaction*, facade::SinkReplyBuilder*,
115
- ConnectionContext* cntx) const ;
105
+ uint64_t Invoke (CmdArgList args, const CommandContext& cmd_cntx) const ;
116
106
117
107
// Returns error if validation failed, otherwise nullopt
118
108
std::optional<facade::ErrorReply> Validate (CmdArgList tail_args) const ;
@@ -135,15 +125,11 @@ class CommandId : public facade::CommandId {
135
125
136
126
static const char * OptName (CO::CommandOpt fl);
137
127
138
- CommandId&& SetHandler(Handler f) && {
128
+ CommandId&& SetHandler(Handler3 f) && {
139
129
handler_ = std::move (f);
140
130
return std::move (*this );
141
131
}
142
132
143
- CommandId&& SetHandler(Handler2 f) &&;
144
-
145
- CommandId&& SetHandler(Handler3 f) &&;
146
-
147
133
CommandId&& SetValidator(ArgValidator f) && {
148
134
validator_ = std::move (f);
149
135
return std::move (*this );
@@ -169,7 +155,7 @@ class CommandId : public facade::CommandId {
169
155
private:
170
156
bool implicit_acl_;
171
157
std::unique_ptr<CmdCallStats[]> command_stats_;
172
- Handler handler_;
158
+ Handler3 handler_;
173
159
ArgValidator validator_;
174
160
};
175
161
0 commit comments