anchor.diff:  -module(lmq_queue_mgr).
   
   -behaviour(gen_server).
  --export([start_link/1, queue_started/2, create/1, delete/1, find/1, match/1]).
  +-export([start_link/1, queue_started/2, create/1, create/2, delete/1, find/1, match/1]).
   -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
       code_change/3, terminate/2]).
   
  +-include("lmq.hrl").
   -define(SPEC, {lmq_queue_sup,
                  {lmq_queue_sup, start_link, []},
                  permanent, 10000,
  
positive.code:     self() ! {start_queue_supervisor, Sup},
      {ok, #state{}}.
  
  handle_call({create, Name}, _From, S=#state{qmap=QMap}) when is_atom(Name) ->
      case dict:is_key(Name, QMap) of
          true ->
              {reply, ok, S};
          false ->
              ok = lmq_lib:create(Name),
              NewQMap = dict:store(Name, undefined, S#state.qmap),
              {ok, _} = supervisor:start_child(S#state.sup, [Name]),
              {reply, ok, S#state{qmap=NewQMap}}
  
negative.code: create(Name) when is_list(Name) ->
      create(list_to_atom(Name));
  create(Name) when is_atom(Name) ->
      create(Name, ?DEFAULT_QUEUE_PROPS).
  
  create(Name, Props) when is_list(Name) ->
      create(list_to_atom(Name), Props);
  create(Name, Props) when is_atom(Name) ->
      gen_server:call(?MODULE, {create, Name, Props}).
  
  find(Name) when is_list(Name) ->
      find(list_to_atom(Name));
  