anchor.diff:                  
                   {ok, Root} = application:get_env(disco_root),
                   FName = filename:join([Root, disco_server:jobhome(JobName), "events"]),
  -                {ok, F} = file:open(FName, [append,
  -                        {delayed_write, ?WRITE_BUFFER, ?BUFFER_TIMEOUT}]),
  -                ets:insert(event_files, {JobName, F}),
  +                Pid = spawn(fun() -> job_event_handler(FName) end),
  +                ets:insert(event_files, {JobName, Pid}),
   
                   {noreply, add_event(Host, JobName, M, P, {Events, MsgBuf})}
           end;
  
positive.code: handle_cast({job_done, JobName}, {Events, MsgBuf} = S) ->
          case ets:lookup(event_files, JobName) of
                  [] -> ok;
                  [{_, F}] ->
                          file:close(F),
                          ets:delete(event_files, JobName)
          end,
          case dict:find(JobName, MsgBuf) of
  
negative.code:         event(event_server, Host, JobName, Format, Args, Params).
  
  event(EventServ, Host, JobName, Format, Args, Params) ->
          SArgs = lists:map(fun(X) ->
                  L = lists:flatlength(io_lib:fwrite("~p", [X])) > 1000,
                  if L -> trunc_io:fprint(X, 1000);
                  true -> X 
          end end, Args),
  
          M = list_to_binary(json:encode(
                  list_to_binary(io_lib:fwrite(Format, SArgs)))),
          gen_server:cast(EventServ, {add_job_event, Host, JobName, M, Params}).
          
  % callback stubs
  