Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
start monic_lru with app
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Mar 12, 2011
1 parent 2c37b76 commit 699faef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/monic_lru.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-behavior(gen_server).

%% public API
-export([new/2, update/2]).
-export([start_link/2, update/2]).

%% gen_server API
-export([init/1, terminate/2, code_change/3,handle_call/3, handle_cast/2, handle_info/2]).
Expand All @@ -32,7 +32,7 @@

%% public functions.

new(Capacity, EvictionFun) when is_function(EvictionFun) ->
start_link(Capacity, EvictionFun) when is_function(EvictionFun) ->
gen_server:start_link(?MODULE, {Capacity, EvictionFun}, []).

%% gen_server callbacks
Expand Down
5 changes: 4 additions & 1 deletion src/monic_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@ init([]) ->
Web = {webmachine_mochiweb,
{webmachine_mochiweb, start, [WebConfig]},
permanent, 5000, worker, dynamic},
Processes = [Web],
Lru = {monic_lru,
{monic_lru, start_link, [100, fun monic_file:close/1]},
permanent, 5000, worker, dynamic},
Processes = [Web, Lru],
{ok, { {one_for_one, 10, 10}, Processes} }.

0 comments on commit 699faef

Please sign in to comment.