8000 Removes explicit synchronous/wait code from Index and Collection Rest… · solisoft/arangodb@9f58035 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f58035

Browse files
Removes explicit synchronous/wait code from Index and Collection RestHandler. (arangodb#21677)
1 parent 5e60226 commit 9f58035

File tree

8 files changed

+284
-372
lines changed

8 files changed

+284
-372
lines changed

arangod/RestHandler/RestCollectionHandler.cpp

Lines changed: 152 additions & 159 deletions
Large diffs are not rendered by default.

arangod/RestHandler/RestCollectionHandler.h

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,37 @@
2828
#include "VocBase/Methods/Collections.h"
2929

3030
namespace arangodb {
31+
template<typename>
32+
struct async;
3133

3234
class LogicalCollection;
3335

34-
class RestCollectionHandler : public arangodb::RestVocbaseBaseHandler {
36+
class RestCollectionHandler : public RestVocbaseBaseHandler {
3537
public:
3638
RestCollectionHandler(ArangodServer&, GeneralRequest*, GeneralResponse*);
3739

38-
char const* name() const override final { return "RestCollectionHandler"; }
39-
RequestLane lane() const override final;
40+
char const* name() const final { return "RestCollectionHandler"; }
41+
RequestLane lane() const final;
4042

41-
RestStatus execute() override final;
42-
void shutdownExecute(bool isFinalized) noexcept override final;
43+
futures::Future<futures::Unit> executeAsync() final;
44+
void shutdownExecute(bool isFinalized) noexcept final;
4345

4446
protected:
4547
enum class FiguresType { None = 0, Standard = 1, Detailed = 2 };
4648

4749
enum class CountType { None = 0, Standard = 1, Detailed = 2 };
4850

49-
void collectionRepresentation(std::string const& name, bool showProperties,
50-
FiguresType showFigures, CountType showCount);
51+
async<void> collectionRepresentation(std::string const& name,
52+
bool showProperties,
53+
FiguresType showFigures,
54+
CountType showCount);
5155

52-
void collectionRepresentation(std::shared_ptr<LogicalCollection> coll,
53-
bool showProperties, FiguresType showFigures,
54-
CountType showCount);
56+
8000 async<void> collectionRepresentation(std::shared_ptr<LogicalCollection> coll,
57+
bool showProperties,
58+
FiguresType showFigures,
59+
CountType showCount);
5560

56-
void collectionRepresentation(methods::Collections::Context& ctxt,
57-
bool showProperties, FiguresType showFigures,
58-
CountType showCount);
59-
60-
futures::Future<futures::Unit> collectionRepresentationAsync(
61+
futures::Future<futures::Unit> collectionRepresentation(
6162
methods::Collections::Context& ctxt, bool showProperties,
6263
FiguresType showFigures, CountType showCount);
6364

@@ -66,13 +67,13 @@ class RestCollectionHandler : public arangodb::RestVocbaseBaseHandler {
6667
velocypack::Builder& builder) = 0;
6768

6869
private:
69-
RestStatus standardResponse();
70+
void standardResponse();
7071
futures::Future<futures::Unit> initializeTransaction(LogicalCollection&);
7172

72-
futures::Future<RestStatus> handleCommandGet();
73-
void handleCommandPost();
74-
futures::Future<RestStatus> handleCommandPut();
75-
void handleCommandDelete();
73+
async<void> handleCommandGet();
74+
async<void> handleCommandPost();
75+
async<void> handleCommandPut();
76+
async<void> handleCommandDelete();
7677

7778
VPackBuilder _builder;
7879
std::unique_ptr<transaction::Methods> _activeTrx;

0 commit comments

Comments
 (0)
0