anchor.diff:      comet(F, default).
   
   %% @doc Convenience method to start a comet process.
  +comet({Name, F}, Pool) when is_function(F) ->
  +    Pid = spawn_with_context({Name, F}, page),
  +    wf:wire(page, page, #comet { function={Name, F}, pool=Pool, scope=local }),
  +    {ok, Pid};
   comet(F, Pool) ->
       Pid = spawn_with_context(F,page),
       wf:wire(page, page, #comet { function=Pid, pool=Pool, scope=local }),
       {ok, Pid}.
   
   %% @doc Convenience method to start a comet process with global pool.
  +comet_global({Name, F}, Pool) ->
  +    Pid = spawn_with_context({Name, F}, page),
  +    wf:wire(page, page, #comet { function={Name, F}, pool=Pool, scope=global }),
  +    {ok, Pid};
   comet_global(F, Pool) ->
       Pid = spawn_with_context(F,page),
       wf:wire(page, page, #comet { function=Pid, pool=Pool, scope=global }),
  
positive.code:         Function(),
          flush() 
      end),
  
      case Mode of
          postback -> do_nothing;
          page ->
              %% This function gets called before we've verified that the browser
              %% is even doing JS, and without JS, this will never get assigned 
              %% an accumulator.  So here's a hack to make sure that the accumulator
              %% exists after 20 seconds, and if not, it simply kills the pid
              start_accumulator_check_timer(Pid)
      end,
      Pid.
  
  get_accumulator_checker_pid(Pid) ->
      Key = get_accumulator_checker_key(Pid),
      {ok, _CheckPid} = process_registry_handler:get_pid(Key).
  
  get_accumulator_checker_key(Pid) ->
      _Key = {accumulator_check_timer,Pid}.
  
negative.code: 
      % Create a process for the AsyncFunction...
      FunctionPid = case Record#comet.function of
          {Name, F} when is_function(F) ->
              P = spawn_with_context({Name, F}, postback),
              notify_accumulator_checker(P),
              P;
          F when is_function(F) ->
              spawn_with_context(F, postback);
          P when is_pid(P) -> 
              notify_accumulator_checker(P),
              P
      end,
  
  