anchor.diff:  -behaviour(gen_server).
   
   %% API
  --export([start_link/0]).
  +-export([start_link/0,
  +	 subscribe/4]).
  +
   
   %% gen_server callbacks
   -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
   	 terminate/2, code_change/3]).
   
   -define(SERVER, ?MODULE). 
  --type probe() :: atom().
  +-type probe() :: list().
   -type datapoint() :: atom().
  --type argument() :: any().
   -type value() :: any().
  +-type mod_state() :: any().
   -type recipient() :: pid() | atom().
  +-type options() :: [ { atom(), any()} ].
   
   -type key() :: { pid | module, recipient(), probe(), datapoint()}.
   
   %% Callback for function, not cast-based, reports that
   %% are invoked in-process.
  --callback exometer_report(probe(), datapoint(), value(), argument()) -> any().
  -
  +-callback report(probe(), datapoint(), value(), mod_state()) -> any().
  +-callback init(options()) -> any().
   
   -record(subscriber, { 
   	  key :: key(),
  
positive.code: 
  
  handle_call(_Request, _From, State) ->
      Reply = ok,
      {reply, Reply, State}.
  
  
negative.code: %%                     {stop, Reason}
  %% @end
  %%--------------------------------------------------------------------
  init(Opts) ->
  
      %% Dig out the mod opts.
      %% { modules, [ {module1, [{opt1, val}, ...]}, {module2, [...]}]}
      {value, {modules, Modules}, _Opts1 } = lists:keytake(modules, 1, Opts), 
      
      %% Traverse list and init modules.
      %% If init fails, leave module out of module state list
      ModStates = lists:foldl(fun(ModConfig, Acc) ->  
  			      { Mod, ModOpts} = ModConfig,
  			      case Mod:init(ModOpts) of 
  				  {ok, St} ->[ { Mod, St } | Acc ];
  				  _ -> Acc
  			      end
  		       end, [], Modules),
      
      
  
      {ok, #st{ 
         subscribers = [],
         mod_states = ModStates
        }}.
  
  %%--------------------------------------------------------------------
  