anchor.diff:  ]).
   
   
  +-define(CACHE, ddoc_cache_lru).
   -define(OPENING, ddoc_cache_opening).
   
   -type dbname() :: iodata().
  
positive.code:             Fun -> [Fun]
          end
      end, DDocs),
      ok = ets_lru:insert(ddoc_cache_lru, {DbName, validation_funs}, Funs),
      exit({open_ok, Key, {ok, Funs}});
  open_ddoc({DbName, DDocId}=Key) ->
      try fabric:open_doc(DbName, DDocId, [ejson_body]) of
          {ok, Doc} ->
              ok = ets_lru:insert(ddoc_cache_lru, {DbName, DDocId}, Doc),
              exit({open_ok, Key, {ok, Doc}});
          Else ->
              exit({open_ok, Key, Else})
  
negative.code:     handle_cast({do_evict, DbName, DDocIds}, St);
  
  handle_cast({do_evict, DbName, DDocIds}, St) ->
      ets_lru:remove(?CACHE, {DbName, validation_funs}),
      lists:foreach(fun(DDocId) ->
          ets_lru:remove(?CACHE, {DbName, DDocId})
      end, DDocIds),
      {noreply, St};
  
  