Skip to content

Commit

Permalink
Improved strand type.
Browse files Browse the repository at this point in the history
Wrapped by any_io_executor.
It helps user's strand access.
When Beast would support any_io_executor correclty, raw_strand would be
erased.
  • Loading branch information
redboltz committed Dec 29, 2023
1 parent c7a5326 commit d6b298c
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 82 deletions.
12 changes: 10 additions & 2 deletions include/async_mqtt/broker/endpoint_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,30 @@ class epsp_wrap {
);
}

#if 0
decltype(auto) strand() const {
return visit(
[&](auto& ep) -> decltype(auto) {
return ep.strand();
}
);
}

decltype(auto) strand() {
return visit(
[&](auto& ep) -> decltype(auto) {
return ep.strand();
}
);
}
#endif

bool in_strand() const {
return visit(
[&](auto& ep) {
return ep.in_strand();
}
);
}

// async functions

template <typename CompletionToken>
Expand Down
Loading

0 comments on commit d6b298c

Please sign in to comment.