tonysun83 commented on a change in pull request #1432: Support callback module
data provider
URL: https://github.com/apache/couchdb/pull/1432#discussion_r202257374
##########
File path: src/couch_epi/src/couch_epi_data.erl
##########
@@ -102,12 +102,15 @@ definitions({file, FilePath}) ->
{error, Reason} ->
{error, {FilePath, Reason}}
end;
-definitions({module, Module}) when is_atom(Module) ->
- definitions({module, [Module]});
-definitions({module, Modules}) ->
+definitions({static_module, Module}) when is_atom(Module) ->
+ definitions({static_module, [Module]});
+definitions({static_module, Modules}) ->
Data = lists:append([M:data() || M <- Modules]),
Hash = couch_epi_functions_gen:hash(Modules),
- {ok, Hash, Data}.
+ {ok, Hash, Data};
+definitions({callback_module, Module}) ->
+ Data = Module:data(),
Review comment:
@iilyak : I tend to agree with your assessment that we only need one type
of "module":
**Because if your data term is hardcoded anyway why would you generate a
wrapper module.**
I would just change callback_module to module and remove static_module.
The tests ran fine for me.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services