Skip to content

Commit

Permalink
Pulled from Klaus Trainer's fork.
Browse files Browse the repository at this point in the history
Thanks.

Fix @type and @SPEC annotations, so that there
aren't any syntax errors when running edoc.
  • Loading branch information
fdmanana committed Aug 23, 2010
1 parent 681a6dc commit ad3efa4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions term_cache.erl
Expand Up @@ -33,32 +33,32 @@
atimes_ets
}).

%% @type Cache() -> pid | atom
%% @type Key() -> term()
%% @type Item() -> term()
%% @type cache() = pid() | atom()
%% @type key() = term()
%% @type item() = term()


%% @spec get(Cache(), Key()) -> {ok, Item()} | not_found
%% @spec get(cache(), key()) -> {ok, item()} | not_found
get(Cache, Key) ->
gen_server:call(Cache, {get, Key}, infinity).


%% @spec put(Cache(), Key(), Item()) -> ok
%% @spec put(cache(), key(), item()) -> ok
put(Cache, Key, Item) ->
ok = gen_server:cast(Cache, {put, Key, Item}).


%% @spec start_link(Options()) -> {ok, pid()}
%% @type Options() -> [ Option() ]
%% @type Option() -> {name, atom()} | {policy, Policy()} | {size, int()} |
%% @spec start_link(options()) -> {ok, pid()}
%% @type options() = [ option() ]
%% @type option() = {name, atom()} | {policy, policy()} | {size, int()} |
%% {ttl, int()}
%% @type Policy() -> lru | mru
%% @type policy() = lru | mru
start_link(Options) ->
Name = value(name, Options, ?MODULE),
gen_server:start_link({local, Name}, ?MODULE, Options, []).


%% @spec stop(Cache()) -> ok.
%% @spec stop(cache()) -> ok
stop(Cache) ->
ok = gen_server:call(Cache, stop).

Expand Down

0 comments on commit ad3efa4

Please sign in to comment.