anchor.diff:  -define(EVENT_PAGE_SIZE, 100).
   -define(EVENT_BUFFER_SIZE, 1000).
   -define(EVENT_BUFFER_TIMEOUT, 2000).
  +
  +-type joblist_entry() :: {JobName :: binary(),
  +                          process_status(),
  +                          StartTime :: erlang:timestamp(),
  +                          JobCoordinator :: pid()}.
   
   -type job_eventinfo() :: {StartTime :: binary(),
                             JobCoordinator :: pid(),
  
positive.code: end_job(JobName) ->
      gen_server:cast(?MODULE, {job_done, JobName}).
  
  -type joblist_entry() :: {JobName :: binary(),
                            process_status(),
                            StartTime :: erlang:timestamp(),
                            JobCoordinator :: pid()}.
  
  -spec get_jobs() -> {ok, [joblist_entry()]}.
  get_jobs() ->
  
negative.code: get_results(JobName) ->
      gen_server:call(?MODULE, {get_results, JobName}).
  
  % Event logging.
  
  -spec event(jobname(), nonempty_string(), list(), tuple()) -> ok.
  event(JobName, Format, Args, Params) ->
      event("master", JobName, Format, Args, Params).
  
  -spec event(host(), jobname(), nonempty_string(), list(), tuple()) -> ok.
  event(Host, JobName, Format, Args, Params) ->
      event(?MODULE, Host, JobName, Format, Args, Params).
  
  -spec event(server(), host(), jobname(), nonempty_string(), list(), tuple()) -> ok.
  event(EventServer, Host, JobName, Format, Args, Params) ->
      RawMsg = disco:format(Format, Args),
      Json = try mochijson2:encode(list_to_binary(RawMsg))
             catch _:_ ->
                     Hex = ["WARNING: Binary message data: ",
                            [io_lib:format("\\x~2.16.0b",[N]) || N <- RawMsg]],
                     mochijson2:encode(list_to_binary(Hex))
             end,
      Msg = list_to_binary(Json),
      gen_server:cast(EventServer, {add_job_event, Host, JobName, Msg, Params}).
  
  -spec task_event(task(), term()) -> ok.
  task_event(Task, Event) ->
      task_event(Task, Event, {}).
  
  -spec task_event(task(), term(), tuple()) -> ok.
  task_event(Task, Event, Params) ->
      task_event(Task, Event, Params, "master").
  
  -spec task_event(task(), term(), tuple(), host()) -> ok.
  task_event(Task, Event, Params, Host) ->
      task_event(Task, Event, Params, Host, ?MODULE).
  
  -spec task_event(task(), term(), tuple(), host(), server()) -> ok.
  task_event(Task, {Type, Message}, Params, Host, EventServer) ->
      event(EventServer,
            Host,
            Task#task.jobname,
            "~s: [~s:~B] " ++ task_format(Message),
            [Type, Task#task.mode, Task#task.taskid, Message],
            Params);
  task_event(Task, Message, Params, Host, EventServer) ->
      task_event(Task, {<<"SYS">>, Message}, Params, Host, EventServer).
  
  % Server.
  
  -spec start_link() -> {ok, pid()}.
  start_link() ->
  