anchor.diff:              %% Received response from current request.
               %% Notify the requesting process
   			Requester ! {self(), Result},
  -            instance_manager_loop(RackPid, {busy, []}, WaitThreshold)
  +            instance_manager_loop(RackPid, {busy, []}, WaitThreshold);
  +		terminate -> 
  +            pg2:get_closest_pid(request_pool) ! terminate,
  +			instance_manager_loop(RackPid, {clogged, []}, WaitThreshold)
       end.
   
   port_loop(Port, Timeout, Command) ->
  
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)
              
  