Changelog

A description of the changes made to continuable.

Versions

Following versions were released:

3.0.0

New helper functions

New helper functions were added to create ready continuables:

Improvements to connections

The implementation of connections were rewritten entirely. It is possible now to connect runtime sized containers as well as deeply nested sequences. See tutorial-connections for details.

Additionally connection overloads were added that accept two iterators in order to come closer to the interface of the standard library.

Also populate was added which makes it possible to populate a dynamic container from continuable_base objects.

Disabled copies for promises and continuables entirely

The promise_base and continuable_base is now non copyable. This change should make it easier to work with the move only semantic of continuables in order to make less mistakes.

Traversal API

A new traversal API for synchronous and asynchronous pack traversal was added which makes it easy to specify new connection types.

2.0.0

Error handling

Usually it is inconvenient to handle error codes and exceptions in an asynchronous context, as we all know std::future supports error handling through exceptions already. We now introduce this capability to the continuable library while allowing error codes to be used as well.

Consider the function cti::continuable<> get_bad_continuable() which always resolves through an error, then you may handle the error code or exception as following:

get_bad_continuable()
  .then([] {
    // ... never invoked
  })
  .then([] {
    // ... never invoked as well
  })
  .fail([] (std::exception_ptr e) {
    try {
      std::rethrow_exception(e);
    } catch(std::exception const& e) {
      // Handle the exception here
    }
  });

Abstracting callbacks as promises

Since a callback may be called through an error or result the cri::promise class was added in order ro provide a similar interface to std::promise:

auto http_request(std::string url) {
  return cti::make_continuable<std::string>(
    [url = std::move(url)](cti::promise<std::string> promise) {
      // Perform the actual request through a different library,
      // resolve the promise upon completion of the task.
      promise.set_value("<html> ... </html>");
      // ...or promise.set_exception(...);
    });
}

co_await support

Experimental coroutine (co_await and co_return) support was added, this is available on MSVC 2017 and Clang 5.0.

int i = co_await cti::make_continuable<int>([](auto&& promise) {
  promise.set_value(0);
});

Minor improvements

The library was improved in other ways:

  • constexpr and noexcept improvements
  • Compile-time improvements
  • Documentation improvements

Header split

Since the overall library size was increased the headers were split into smaller chunks.

1.0.0

  • Documentation and readme changes
  • Change the assertion type of some GTest macros from expected to assertion.

0.8.0 (unstable)

  • Fixes a major issue with handling the ownership for consumed continuables which led to unintended invocations.
  • Adds partial application support which makes it possible to chain callbacks which accept less arguments then the curret signature.

    http_request("github.com")
      .then([] {
        // ...
      });
  • Adds Support for sequential invocation:

    http_request("github.com") >> http_request("atom.io")
      .then([] (std::string github, std::string atom) {
        // ...
      });

0.7.0 (unstable)

  • Continuation syntactic sugar
  • Executor support
  • Connection support

Semantic versioning and stability

Continuable strictly follows the rules of semantic versioning, the API is kept stable across minor versions.

The CI driven unit-tests are observed through the Clang sanitizers (asan, ubsan and lsan - when compiling with Clang) or Valgrind (when compiling with GCC) in order to prevent regressions.