chore: pass RedisReplyBuilder explicitly from dragonfly connection (#4009)

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-10-29 14:52:09 +02:00 committed by GitHub
parent 566f246cee
commit 6f6897cef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 156 additions and 230 deletions

View file

@ -24,7 +24,6 @@ class AcceptServer;
namespace dfly {
class Interpreter;
using facade::MemcacheParser;
class Service : public facade::ServiceInterface {
@ -37,14 +36,16 @@ class Service : public facade::ServiceInterface {
void Shutdown();
// Prepare command execution, verify and execute, reply to context
void DispatchCommand(ArgSlice args, facade::ConnectionContext* cntx) final;
void DispatchCommand(ArgSlice args, facade::SinkReplyBuilder* builder,
facade::ConnectionContext* cntx) final;
// Execute multiple consecutive commands, possibly in parallel by squashing
size_t DispatchManyCommands(absl::Span<ArgSlice> args_list,
size_t DispatchManyCommands(absl::Span<ArgSlice> args_list, facade::SinkReplyBuilder* builder,
facade::ConnectionContext* cntx) final;
// Check VerifyCommandExecution and invoke command with args
bool InvokeCmd(const CommandId* cid, CmdArgList tail_args, ConnectionContext* reply_cntx);
bool InvokeCmd(const CommandId* cid, CmdArgList tail_args, facade::SinkReplyBuilder* builder,
ConnectionContext* reply_cntx);
// Verify command can be executed now (check out of memory), always called immediately before
// execution
@ -59,7 +60,7 @@ class Service : public facade::ServiceInterface {
const ConnectionContext& cntx);
void DispatchMC(const MemcacheParser::Command& cmd, std::string_view value,
facade::ConnectionContext* cntx) final;
facade::MCReplyBuilder* builder, facade::ConnectionContext* cntx) final;
facade::ConnectionContext* CreateContext(util::FiberSocketBase* peer,
facade::Connection* owner) final;
@ -169,9 +170,9 @@ class Service : public facade::ServiceInterface {
const ConnectionContext& dfly_cntx);
void EvalInternal(CmdArgList args, const EvalArgs& eval_args, Interpreter* interpreter,
ConnectionContext* cntx);
SinkReplyBuilder* builder, ConnectionContext* cntx);
void CallSHA(CmdArgList args, std::string_view sha, Interpreter* interpreter,
ConnectionContext* cntx);
SinkReplyBuilder* builder, ConnectionContext* cntx);
// Return optional payload - first received error that occured when executing commands.
std::optional<facade::CapturingReplyBuilder::Payload> FlushEvalAsyncCmds(ConnectionContext* cntx,