dragonfly/server/conn_context.h
2021-11-28 09:29:26 +02:00

36 lines
655 B
C++

// Copyright 2021, Roman Gershman. All rights reserved.
// See LICENSE for licensing terms.
//
#pragma once
#include "server/reply_builder.h"
#include "server/common_types.h"
namespace dfly {
class Connection;
class EngineShardSet;
class CommandId;
class ConnectionContext : public ReplyBuilder {
public:
ConnectionContext(::io::Sink* stream, Connection* owner);
// TODO: to introduce proper accessors.
const CommandId* cid = nullptr;
EngineShardSet* shard_set = nullptr;
Connection* owner() {
return owner_;
}
Protocol protocol() const;
ConnectionState conn_state;
private:
Connection* owner_;
};
} // namespace dfly