macula_rpc_service_interests (macula v0.20.5)
View SourceRPC Service Interests Module (Pull-based Discovery)
Handles pull-based service discovery configuration: - Normalizes service interest lists (atoms, binaries, strings) - Validates service interest inputs - Prepares DHT lookup messages for prefetching
Extracted from macula_rpc_handler.erl (Dec 2025) to improve testability and separation of concerns.
Summary
Functions
Create a FIND_VALUE message for a service. Returns the service key and encoded message ready to send.
Log configured service interests during init.
Merge new interests with existing ones (removes duplicates).
Normalize service interests to list of binaries. Accepts various input formats: list of binaries/atoms/strings, or single value.
Normalize a single service interest to binary. Returns {true, Binary} for valid inputs, false for invalid.
Functions
Create a FIND_VALUE message for a service. Returns the service key and encoded message ready to send.
-spec log_interests([binary()]) -> ok.
Log configured service interests during init.
Merge new interests with existing ones (removes duplicates).
Normalize service interests to list of binaries. Accepts various input formats: list of binaries/atoms/strings, or single value.
Normalize a single service interest to binary. Returns {true, Binary} for valid inputs, false for invalid.