Skip to content

Commit b9f4f84

Browse files
iahsfacebook-github-bot
authored andcommitted
Deprecate ServerStream::toClientStream
Summary: Encourage users to write their tests properly Reviewed By: andriigrynenko Differential Revision: D25003810 fbshipit-source-id: 728beeb3eeaf3052502dbfdb88888a37cf1ff839
1 parent 1b3cd97 commit b9f4f84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

yarpl/test/ThriftStreamShimTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ std::vector<T> run(
3535
template <typename T>
3636
std::vector<T> run(apache::thrift::ServerStream<T>&& stream) {
3737
std::vector<T> values;
38-
std::move(stream).toClientStream().subscribeInline([&](auto&& val) {
38+
std::move(stream).toClientStreamUnsafeDoNotUse().subscribeInline([&](auto&& val) {
3939
if (val.hasValue()) {
4040
values.push_back(std::move(*val));
4141
}
@@ -50,7 +50,7 @@ apache::thrift::ClientBufferedStream<int> makeRange(int start, int count) {
5050
streamAndPublisher.second.next(i + start);
5151
}
5252
std::move(streamAndPublisher.second).complete();
53-
return std::move(streamAndPublisher.first).toClientStream();
53+
return std::move(streamAndPublisher.first).toClientStreamUnsafeDoNotUse();
5454
}
5555

5656
TEST(ThriftStreamShimTest, ClientStream) {
@@ -64,7 +64,7 @@ TEST(ThriftStreamShimTest, ServerStream) {
6464
EXPECT_EQ(run(std::move(stream)), std::vector<long>({1, 2, 3, 4, 5}));
6565

6666
stream = ThriftStreamShim::toServerStream(Flowable<long>::never());
67-
auto sub = std::move(stream).toClientStream().subscribeExTry(
67+
auto sub = std::move(stream).toClientStreamUnsafeDoNotUse().subscribeExTry(
6868
folly::getEventBase(), [](auto) {});
6969
sub.cancel();
7070
std::move(sub).join();

0 commit comments

Comments
 (0)