feat(ds): allow to turn monotonic timestamps off for DB

That tells implementation how to assign timestamps to messages. Current
implicit default is now `force_monotonic_timestamps => true`.
This commit is contained in:
Andrew Mayorov 2024-07-11 19:57:25 +02:00
parent ffa69df6f8
commit ae3812da85
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
2 changed files with 7 additions and 1 deletions

View File

@ -151,7 +151,6 @@ ensure_monotonic_timestamp(ShardId) ->
%%================================================================================
-record(s, {}).
-define(timer_update, timer_update).
init([]) ->
process_flag(trap_exit, true),

View File

@ -169,6 +169,13 @@
-type generic_db_opts() ::
#{
backend := atom(),
%% Force strictly monotonic message timestamps.
%% Default: `true'.
%% Messages are assigned unique, strictly monotonically increasing timestamps.
%% Those timestamps form a total order per each serialization key.
%% If `false' then message timestamps are respected; timestamp, topic and
%% serialization key uniquely identify a message.
force_monotonic_timestamps => boolean(),
serialize_by => clientid | topic,
_ => _
}.