anchor.diff:                      {ok, NextTimerRef} = timer:send_after(WaitThreshold, threshold_elapsed),    
   			        instance_manager_loop(RackPid, {busy, [{timer, NextTimerRef} | OtherRequests]}, WaitThreshold)
               end;
  +        terminate ->
  +			instance_manager_loop(RackPid, {busy, [{timer, TimerRef}, terminate | QueuedRequests]}, WaitThreshold);
           threshold_elapsed ->
   			instance_manager_loop(RackPid, {clogged, [{timer, TimerRef} | QueuedRequests]}, WaitThreshold)
   	end;
  
positive.code:     end).
  
  stop_instance_managers(Count) ->
      %% TODO: Send terminate message to Count instance managers
      [pg2:get_closest_pid(request_pool) ! {self(), terminate} || _ <- lists:seq(1, Count)]. 
  
  %% Instance manager may be in one of three states: idle, busy, or clogged.
  %%   idle - the instance manager is not managing any requests
  
negative.code: %%   clogged - the current request being processed by the instance manager
  %%             has taken longer than a pre-configured wait threshold. This
  %%             value is set in the yaws configuration file.
  %% TODO: Maybe use gen_fsm to model instance_manager behavior
  instance_manager_loop(RackPid, {idle, []}, WaitThreshold) ->
  	receive
          {Requester, {request, Req}} -> 
  			RackPid ! {self(), Requester, {request, Req}},
              {ok, TimerRef} = timer:send_after(WaitThreshold, threshold_elapsed),    
  			instance_manager_loop(RackPid, {busy, [{timer, TimerRef}]}, WaitThreshold);
          terminate -> 
  			RackPid ! {self(), terminate};
          _ ->
  			instance_manager_loop(RackPid, {idle, []}, WaitThreshold)
              
  