Skip to content

Commit 8f7b9e4

Browse files
authored
Merge pull request #126 from Cristinag/complete_flags
Remove unnecessary COMPLETE flag checks in Responders
2 parents 3eb1521 + 35e058d commit 8f7b9e4

6 files changed

+8
-120
lines changed

CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ add_library(
9292
src/automata/StreamSubscriptionResponderBase.h
9393
src/automata/StreamRequester.cpp
9494
src/automata/StreamRequester.h
95-
src/automata/StreamResponder.cpp
9695
src/automata/StreamResponder.h
9796
src/automata/SubscriptionRequester.cpp
9897
src/automata/SubscriptionRequester.h
99-
src/automata/SubscriptionResponder.cpp
10098
src/automata/SubscriptionResponder.h
10199
src/ConnectionAutomaton.cpp
102100
src/ConnectionAutomaton.h

TARGETS

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ cxx_library(
4343
'src/automata/StreamSubscriptionRequesterBase.cpp',
4444
'src/automata/StreamSubscriptionResponderBase.cpp',
4545
'src/automata/StreamRequester.cpp',
46-
'src/automata/StreamResponder.cpp',
4746
'src/automata/SubscriptionRequester.cpp',
48-
'src/automata/SubscriptionResponder.cpp',
4947
'src/ConnectionAutomaton.cpp',
5048
'src/Frame.cpp',
5149
'src/NullRequestHandler.cpp',

src/automata/StreamResponder.cpp

-37
This file was deleted.

src/automata/StreamResponder.h

+4-21
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,15 @@
44

55
#include <iosfwd>
66

7-
#include "reactive-streams/utilities/AllowanceSemaphore.h"
8-
#include "reactive-streams/utilities/SmartPointers.h"
9-
#include "src/AbstractStreamAutomaton.h"
10-
#include "src/Frame.h"
11-
#include "src/Payload.h"
12-
#include "src/ReactiveStreamsCompat.h"
137
#include "src/automata/StreamSubscriptionResponderBase.h"
148
#include "src/mixins/ExecutorMixin.h"
159
#include "src/mixins/LoggingMixin.h"
1610
#include "src/mixins/MemoryMixin.h"
1711
#include "src/mixins/SinkIfMixin.h"
1812
#include "src/mixins/StreamIfMixin.h"
1913

20-
namespace folly {
21-
class exception_wrapper;
22-
}
23-
2414
namespace reactivesocket {
2515

26-
enum class StreamCompletionSignal;
27-
2816
/// Implementation of stream automaton that represents a Stream responder
2917
class StreamResponderBase : public StreamSubscriptionResponderBase {
3018
using Base = StreamSubscriptionResponderBase;
@@ -33,15 +21,10 @@ class StreamResponderBase : public StreamSubscriptionResponderBase {
3321
using Base::Base;
3422

3523
protected:
36-
/// @{
37-
38-
/// Not all frames are intercepted, some just pass through.
39-
using Base::onNextFrame;
40-
41-
void onNextFrame(Frame_REQUEST_STREAM&&);
42-
43-
std::ostream& logPrefix(std::ostream& os);
44-
/// @}
24+
std::ostream& logPrefix(std::ostream& os) {
25+
return os << "StreamResponder(" << &connection_ << ", " << streamId_
26+
<< "): ";
27+
}
4528
};
4629

4730
using StreamResponder = SinkIfMixin<StreamIfMixin<LoggingMixin<ExecutorMixin<

src/automata/SubscriptionResponder.cpp

-38
This file was deleted.

src/automata/SubscriptionResponder.h

+4-20
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,15 @@
44

55
#include <iosfwd>
66

7-
#include "reactive-streams/utilities/AllowanceSemaphore.h"
8-
#include "reactive-streams/utilities/SmartPointers.h"
9-
#include "src/AbstractStreamAutomaton.h"
10-
#include "src/Frame.h"
11-
#include "src/Payload.h"
12-
#include "src/ReactiveStreamsCompat.h"
137
#include "src/automata/StreamSubscriptionResponderBase.h"
148
#include "src/mixins/ExecutorMixin.h"
159
#include "src/mixins/LoggingMixin.h"
1610
#include "src/mixins/MemoryMixin.h"
1711
#include "src/mixins/SinkIfMixin.h"
1812
#include "src/mixins/StreamIfMixin.h"
1913

20-
namespace folly {
21-
class exception_wrapper;
22-
}
23-
2414
namespace reactivesocket {
2515

26-
enum class StreamCompletionSignal;
27-
2816
/// Implementation of stream automaton that represents a Subscription responder.
2917
class SubscriptionResponderBase : public StreamSubscriptionResponderBase {
3018
using Base = StreamSubscriptionResponderBase;
@@ -33,14 +21,10 @@ class SubscriptionResponderBase : public StreamSubscriptionResponderBase {
3321
using Base::Base;
3422

3523
protected:
36-
/// @{
37-
/// Not all frames are intercepted, some just pass through.
38-
using Base::onNextFrame;
39-
40-
void onNextFrame(Frame_REQUEST_SUB&&);
41-
42-
std::ostream& logPrefix(std::ostream& os);
43-
/// @}
24+
std::ostream& logPrefix(std::ostream& os) {
25+
return os << "SubscriptionResponder(" << &connection_ << ", " << streamId_
26+
<< "): ";
27+
}
4428
};
4529

4630
using SubscriptionResponder =

0 commit comments

Comments
 (0)