Commit 85724a41 authored by Andrew Smith's avatar Andrew Smith Committed by Facebook GitHub Bot

Change FanoutChannel to synchronously process handle destruction.

Summary: This ensures that closing a FanoutChannel will synchronously cancel its input receiver. We don't need to run this code on the provided executor, because it is not running as part of a callback (and because we already have a lock).

Reviewed By: aary

Differential Revision: D32191795

fbshipit-source-id: 9ec2a2303a12580e052de7af8651ebf5b773b8b6
parent b0066f2b
...@@ -180,10 +180,8 @@ class FanoutChannelProcessor ...@@ -180,10 +180,8 @@ class FanoutChannelProcessor
* This is called when the user's FanoutChannel object has been destroyed. * This is called when the user's FanoutChannel object has been destroyed.
*/ */
void destroyHandle(CloseResult closeResult) { void destroyHandle(CloseResult closeResult) {
executor_->add([=, closeResult = std::move(closeResult)]() mutable { auto state = state_.wlock();
auto state = state_.wlock(); processHandleDestroyed(state, std::move(closeResult));
processHandleDestroyed(state, std::move(closeResult));
});
} }
/** /**
......
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