Convert geef_odb to a gen_server

This commit is contained in:
Carlos Martín Nieto
2013-05-23 10:49:00 +02:00
parent 41113f3221
commit 7b1dacffc7
3 changed files with 88 additions and 21 deletions

View File

@@ -64,7 +64,7 @@ workdir(Pid) ->
%% @doc The repository's current object database. This encompasses all
%% the configured backends.
-spec odb(pid()) -> {ok, geef_odb()} | {error, term}.
-spec odb(pid()) -> {ok, pid()} | {error, term}.
odb(Pid) ->
gen_server:call(Pid, odb).
@@ -176,7 +176,7 @@ start_link(Handle) ->
handle_odb(Handle) ->
case geef_nif:repository_get_odb(Handle) of
{ok, OdbHandle} ->
{ok, #geef_odb{handle=OdbHandle}};
geef_odb:start_link(OdbHandle);
Other ->
Other
end.