Skip to content

v0.2.0

Choose a tag to compare

@kamchatka-volcano kamchatka-volcano released this 12 Jul 20:11
· 21 commits to master since this release

This release is not backwards compatible with v0.1.0. Please refer to the README for detailed information about the new interface.

  • The asyncgi::App has been replaced with the asyncgi::IO service. The factory functions makeApp, makeServer, makeClient, makeTimer, and makeAsioDispatcher have been removed. Now, all entities are created on the stack and take a reference to an asyncgi::IO object in their constructors.

Before:

auto app = asyncgi::makeApp();
auto serverPtr = app->makeServer();

After:

auto io = asyncgi::IO{};
auto server = asyncgi::Server{io};
  • The asyncgi::RequestProcessor base class has been removed. Now, any callable with a compatible signature of void(const asyncgi::Request&, asyncgi::Response&) can be used for request processing.

  • The asyncgi::Router now allows passing regular expression capturing group values to the arguments of registered request processors.

router.route(asyncgi::rx{"/page/(\\d)")`).process([](int pageNumber, const asyncgi::Request&, asyncgi::Response&){ ... });

  • The route context is no longer embedded in the asyncgi::Response object. Instead, it is passed as the last argument to the request processor.
auto router = asyncgi::Router<Context>{};
router.route().process([](const asyncgi::Request&, asyncgi::Response&, Context& context){ ... });
  • The asyncgi::RouteSpecification has been renamed to asyncgi::RouteMatcher.
  • The TimerMode enum has been replaced with the startPeriodic() timer method.
  • Windows support has been added, along with functional tests and CI configuration.
  • Compatibility with Boost.Asio has been added.