anchor.diff:  %
   % msgbuf dict: jobname -> { <nmsgs>, <list-length>, [<msg>] }
   %
  -
  --type process_status() :: active | dead | ready.
  -process_status(Pid) ->
  -    case is_process_alive(Pid) of
  -        true -> active;
  -        false -> dead
  -    end.
  -
  -json_list(List) -> json_list(List, []).
  -json_list([], _) -> [];
  -json_list([X], L) ->
  -    [<<"[">>, lists:reverse([X|L]), <<"]">>];
  -json_list([X|R], L) ->
  -    json_list(R, [<<X/binary, ",">>|L]).
  -
  --spec unique_key(jobname(), dict()) -> invalid_prefix | {ok, jobname()}.
  -unique_key(Prefix, Dict) ->
  -    C = string:chr(Prefix, $/) + string:chr(Prefix, $.),
  -    if C > 0 ->
  -        invalid_prefix;
  -    true ->
  -        {MegaSecs, Secs, MicroSecs} = now(),
  -        Key = disco:format("~s@~.16b:~.16b:~.16b", [Prefix, MegaSecs, Secs, MicroSecs]),
  -        case dict:is_key(Key, Dict) of
  -            false ->
  -                {ok, Key};
  -            true ->
  -                unique_key(Prefix, Dict)
  -        end
  -    end.
  -
   -type state() :: {dict(), dict()}.
   
   -spec init(_) -> gs_init().
  
positive.code: -module(event_server).
  -behaviour(gen_server).
  
  -export([new_job/2, end_job/1, clean_job/1,
           get_jobs/0, get_jobs/1, get_jobinfo/1, get_job_events/3,
           get_map_results/1, get_results/1,
           event/4, event/5, event/6,
           task_event/2, task_event/3, task_event/4, task_event/5]).
  -export([start_link/0, init/1, handle_call/3, handle_cast/2, handle_info/2,
           terminate/2, code_change/3]).
  
  
negative.code:     lager:warning("Unknown message received: ~p", [Msg]),
      {noreply, State}.
  
  -spec terminate(term(), state()) -> ok.
  terminate(_Reason, _State) -> ok.
  
  -spec code_change(term(), state(), term()) -> {ok, state()}.
  code_change(_OldVsn, State, _Extra) -> {ok, State}.
  
  % Server implemention.
  
  add_event(Host0, JobName, Msg, Params, {Events, MsgBuf}) ->
      {ok, {NMsg, LstLen0, MsgLst0}} = dict:find(JobName, MsgBuf),
  