Skip to content

Commit dd11df6

Browse files
committed
chore: capy changes
1 parent 11a6bad commit dd11df6

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

include/boost/http/server/route_handler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#include <boost/http/detail/config.hpp>
1414
#include <boost/http/server/router_types.hpp>
15+
#include <boost/capy/affine.hpp>
1516
#include <boost/capy/datastore.hpp>
16-
#include <boost/capy/executor.hpp>
1717
#include <boost/capy/task.hpp>
1818
#include <boost/http/request.hpp> // VFALCO forward declare?
1919
#include <boost/http/request_parser.hpp> // VFALCO forward declare?
@@ -84,7 +84,7 @@ struct BOOST_HTTP_SYMBOL_VISIBLE
8484

8585
/** Executor associated with the session.
8686
*/
87-
capy::executor ex;
87+
capy::any_dispatcher ex;
8888

8989
/** Destructor
9090
*/

src/server/route_handler.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <boost/http/server/route_handler.hpp>
1111
#include <boost/http/string_body.hpp>
12+
#include <boost/capy/async_run.hpp>
1213

1314
namespace boost {
1415
namespace http {
@@ -49,8 +50,6 @@ set_body(std::string s)
4950
return *this;
5051
}
5152

52-
#ifdef BOOST_HTTP_HAS_CORO
53-
5453
auto
5554
route_params::
5655
spawn(
@@ -60,19 +59,17 @@ spawn(
6059
return this->suspend(
6160
[ex = this->ex, t = std::move(t)](resumer resume) mutable
6261
{
63-
capy::spawn(ex, std::move(t),
64-
[resume](system::result<
65-
route_result, std::exception_ptr> r)
62+
capy::async_run(ex)(std::move(t),
63+
[resume](route_result rv)
64+
{
65+
resume(rv);
66+
},
67+
[resume](std::exception_ptr ep)
6668
{
67-
if(r.has_error())
68-
resume(r.error());
69-
else
70-
resume(*r);
69+
resume(ep);
7170
});
7271
});
7372
}
7473

75-
#endif
76-
7774
} // http
7875
} // boost

0 commit comments

Comments
 (0)