From ff53c03952462fc89492c8b806fba42e8c0969b3 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Wed, 7 Feb 2024 12:23:23 +0000 Subject: [PATCH] potential new callback sig readme.md --- README.md | 2 +- src/ra_machine.erl | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48eaf44f..3c464a88 100644 --- a/README.md +++ b/README.md @@ -440,7 +440,7 @@ Ra attempts to follow [Semantic Versioning](https://semver.org/). The modules that form part of the public API are: * `ra` -* `ra_machine` +* `ra_machine` (behaviour callbacks only) * `ra_system` * `ra_counters` * `ra_leaderboard` diff --git a/src/ra_machine.erl b/src/ra_machine.erl index ba54092a..3213272d 100644 --- a/src/ra_machine.erl +++ b/src/ra_machine.erl @@ -232,6 +232,20 @@ -callback init_aux(Name :: atom()) -> term(). +-callback handle_aux(ra_server:ra_state(), + {call, From :: from()} | cast, + Command :: term(), + AuxState, + State) -> + {reply, Reply :: term(), AuxState, State} | + {reply, Reply :: term(), AuxState, State, + [{monitor, process, aux, pid()}]} | + {no_reply, AuxState, State} | + {no_reply, AuxState, State, + [{monitor, process, aux, pid()}]} + when AuxState :: term(), + State :: ra_aux:state(). + -callback handle_aux(ra_server:ra_state(), {call, From :: from()} | cast, Command :: term(),