Skip to content

Khepri 0.10.0

Compare
Choose a tag to compare
@dumbbell dumbbell released this 11 Dec 17:29
· 53 commits to main since this release
v0.10.0
0b8a99d

At this point, Khepri should be considered Beta and not production ready. The API will likely evolve and future releases will likely introduce breaking changes. The goal of this release is to make it easy for anyone to try it and possibly give feedback.

What's new in Khepri 0.10.0

This release brings a single API change around the async operations.

Unify khepri:handle_async_ret/2 return values

Breaking change

The new khepri:handle_async_ret/2 introduced in Khepri 0.9.0 is improved in this new release: it converts the "raw" return values contained in the ra_event to a format similar to all other Khepri sync commands. This allows the function to handle specific cases like exceptions and aborted transactions.

Here is an example of the change to make to your code:

  • Up-to Khepri 0.9.x:

    receive
        {ra_event, _,
         {applied, [{CorrelationId, {ok, _} = Ret}]}} = AsyncRet ->
            %% Call `handle_async_ret/2' for every entries;
            %% here only one:
            ok = khepri:handle_async_ret(StoreId, AsyncRet),
    
            %% Do something with each `Ret'.
            Ret
    end
  • Starting from Khepri 0.10.0:

    receive
        {ra_event, _, _} = AsyncRet ->
            %% Call `handle_async_ret/2' once and get a list of correlation
            %% ID/return value pairs.
            [{CorrelationId, Ret}] = khepri:handle_async_ret(StoreId, AsyncRet),
    
            %% Do something with each `Ret'.
            Ret
    end

See #234.

Download

Khepri 0.10.0 is available from Hex.pm: https://hex.pm/packages/khepri/0.10.0

Upgrade

Using Rebar:

  1. Update your rebar.config:

    %% In rebar.config
    {deps, [{khepri, "0.10.0"}]}.
  2. Run rebar3 upgrade khepri.

Using Erlang.mk:

  1. Update your Makefile:

    %% In your Makefile
    dep_khepri = hex 0.10.0
  2. Remove the deps/khepri directory. The new version will be fetched the next time you build your project.

Documentation

The documentation for Khepri 0.10.0 is available on Hex.pm.