% @type age_request_mode() = local | share | share_once | adaptive
-type(age_request_mode() :: local | share | share_once | adaptive).
% @type age_request_version() = string() | undefined
-type(age_request_version() :: string() | undefined).
% @type age_response_state() = ok | error | exit | exception | atom()
-type(age_response_state() :: ok | error | exit | exception | atom()).
% @type age_response_result() = {age_response_state(), any()}
-type(age_response_result() :: {age_response_state(), any()}).
% Request carrier record
-record(age_request, {
% Unique request identifier
rid :: age_uid(),
% List of task definition as {<task type>, <requested terms or binary data>}
tasks :: list(tuple()),
% Task life in milliseconds
life = ?REQUEST_LIFE_DEFAULT :: integer(),
% Request mode (local, share, share_once)
mode = ?REQUEST_MODE_DEFAULT :: age_request_mode(),
% Request version - used with the "adapative" request mode (ref. Adaptive Polymorphism)
version = undefined :: age_request_version(),
% Time stamp when the task has been registered
stamp = {0, 0, 0} :: age_time_stamp(),
% Filter those nodes which have to execute the task. [] = No filter
filter = [] :: list(age_node()),
% Fully qualified route address. [] = shares with everyone
route = [] :: list(age_node()),
% Fully qualified source path (list of confirmed nodes)
source = [] :: list(age_node()),
% Optional parameters
options = [] :: list(tuple())
}).
% Response carrier record
% @type age_response() = {age_response, age_uid(), age_response_result(), float(), list(age_node())}
-record(age_response, {
% Unique task identifier
rid :: age_uid(),
% Response result: {<response state>, <responsed terms or binary data>}
result :: age_response_result(),
% Response time stamp
stamp = {0, 0, 0} :: age_time_stamp(),
% Fully qualified path of the source responding node
source = [] :: list(age_node()),
% Optional parameters to maintain the result
options = [] :: list(tuple())
}).
% Task record
% @type age_task() = {age_task, atom(), any(), list(tuple())}
-record(age_task, {
% Task type
type :: atom(),
% Parameters, identifiers, or binary data
data :: any(),
% Task specific options as list of parameters
options = [] :: list(tuple())
}).
|