anchor.diff:              start_worker(Source, Workload, {Max, NewWorking, Rest})
       end.
   
  -%% actual worker functions
  +%% @doc initialize the worker.
   -spec init_worker(pid_groups:groupname(), job()) -> {ok, pid()}.
   init_worker(DHTNodeGroup, Workload) ->
       Pid = spawn_link(?MODULE, work, [DHTNodeGroup, Workload]),
       {ok, Pid}.
   
  -%% do the actual work
  +%% @doc do the actual work.
  +%%      executes Job and returns results to the local wpool. wpool associates
  +%%      the worker pid to the jobs client and knows where the results go.
   -spec work(pid_groups:groupname(), job()) -> ok.
   work(DHTNodeGroup, {_Round, map, {erlanon, FunBin}, Data}) ->
       %% ?TRACE("worker: should apply ~p to ~p~n", [FunBin, Data]),
  
positive.code:             State
      end.
  
  %% monitor worker and put it into the Working queue
  -spec monitor_worker(pid(), comm:my_pid(), state()) -> state().
  monitor_worker(Pid, Source, {Max, Working, Waiting}) ->
      monitor(process, Pid),
      {Max, [{Pid, Source} | Working], Waiting}.
  
  %% remove worker from Working queue and start a waiting job if present
  -spec cleanup_worker(pid(), state()) -> state().
  cleanup_worker(Pid, {Max, Working, Waiting}) ->
      NewWorking = lists:keydelete(Pid, 1, Working),
  
negative.code: -type(mr_job() :: {Round::pos_integer(),
                     map | reduce,
                     {erlanon | jsanon, binary()},
                     Data::[tuple()]}).
  
  -type(generic_job() :: {erlanon | jsanon, binary(), [tuple()]}).
  