forked from rsocket/rsocket-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColdResumeHandler.cpp
More file actions
33 lines (25 loc) · 878 Bytes
/
ColdResumeHandler.cpp
File metadata and controls
33 lines (25 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2004-present Facebook. All Rights Reserved.
#include "rsocket/ColdResumeHandler.h"
#include "yarpl/flowable/CancelingSubscriber.h"
#include <folly/Conv.h>
using namespace yarpl;
using namespace yarpl::flowable;
namespace rsocket {
std::string ColdResumeHandler::generateStreamToken(
const Payload&,
StreamId streamId,
StreamType) {
return folly::to<std::string>(streamId);
}
Reference<Flowable<Payload>> ColdResumeHandler::handleResponderResumeStream(
std::string /* streamToken */,
size_t /* publisherAllowance */) {
return Flowables::error<Payload>(
std::logic_error("ResumeHandler method not implemented"));
}
Reference<Subscriber<Payload>> ColdResumeHandler::handleRequesterResumeStream(
std::string /* streamToken */,
size_t /* consumerAllowance */) {
return yarpl::make_ref<CancelingSubscriber<Payload>>();
}
}