Commit 9d98a85d authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot

Remove sendRequestSync from RSocketClientChannel

Summary: sendRequestSync should only be implemented by channels, which own threads looping EventBases.

Reviewed By: phoad

Differential Revision: D7464392

fbshipit-source-id: bde6edc85438bb406592291330869972f88c787a
parent e5a6b518
...@@ -36,7 +36,7 @@ typedef Range<const char*> StringPiece; ...@@ -36,7 +36,7 @@ typedef Range<const char*> StringPiece;
* When the ScopedEventBaseThread object is destroyed, the thread will be * When the ScopedEventBaseThread object is destroyed, the thread will be
* stopped. * stopped.
*/ */
class ScopedEventBaseThread { class ScopedEventBaseThread : public IOExecutor {
public: public:
ScopedEventBaseThread(); ScopedEventBaseThread();
explicit ScopedEventBaseThread(const StringPiece& name); explicit ScopedEventBaseThread(const StringPiece& name);
...@@ -50,10 +50,18 @@ class ScopedEventBaseThread { ...@@ -50,10 +50,18 @@ class ScopedEventBaseThread {
return &eb_; return &eb_;
} }
EventBase* getEventBase() override {
return &eb_;
}
std::thread::id getThreadId() const { std::thread::id getThreadId() const {
return th_.get_id(); return th_.get_id();
} }
void add(Func func) override {
getEventBase()->add(std::move(func));
}
private: private:
ScopedEventBaseThread(ScopedEventBaseThread&& other) = delete; ScopedEventBaseThread(ScopedEventBaseThread&& other) = delete;
ScopedEventBaseThread& operator=(ScopedEventBaseThread&& other) = delete; ScopedEventBaseThread& operator=(ScopedEventBaseThread&& other) = delete;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment