anchor.diff:      { noreply, State }.
   
   
  -handle_info( _Info, State ) ->
  -    { noreply, State }.
  +handle_info( { Msg, Tag }, State ) ->
  +    case orddict:find( Tag, State#state.asyncs ) of
  +        { ok, { Pid, Action } } ->
  +            Asyncs = orddict:erase( Tag, State#state.asyncs ),
  +            S1 = State#state{ asyncs = Asyncs },
  +            S2 = case Action of
  +                poll -> handle_poll( Msg, Pid, S1 );
  +                start -> handle_start( Msg, Pid, S1 );
  +                stop -> handle_stop( Msg, Pid, S1 )
  +            end,
  +            { noreply, S2 };
  +        error -> { noreply, State }
  +    end.
   
   
   terminate( _Reason, _State ) ->
  
positive.code:     StopResults = [ stop_device( Pid, element( 2, StartResult ) ) ||
                      StartResult <- StartResults ],
      [ [ { "start device", ?_assertEqual( ok, Res ) } || { Res, _ } <- StartResults ]
      , [ { "stop device", ?_assertEqual( ok, Res ) } || Res <- StopResults ]
      ].
  
  
  test_start_device_error( Pid ) ->
      meck:expect( lurch_dev, start,
                   fun( _Driver, _Parameters ) -> { error, enoent } end ),
      StartResult = start_device( Pid, dummy_driver_config() ),
      [ { "error propagated", ?_assertMatch( { error, _Error }, StartResult ) } ].
  
  
  test_add_list_devices( Pid ) ->
  
negative.code:     Driver = proplists:get_value(driver, Configuration),
      Parameters = proplists:get_value(parameters, Configuration),
      Events = proplists:get_value(events, Configuration, []),
      { ok, Pid, Tag } = lurch_dev:start_async( Driver, Parameters ),
      Device = #device{ pid = Pid
                      , driver = Driver
                      , parameters = Parameters
                      , events = Events
                      , state = starting },
      Devices = orddict:store( Pid, Device, State#state.devices ),
      Asyncs = orddict:store( Tag, { Pid, start } , State#state.asyncs ),
      NewState = State#state{ devices = Devices, asyncs = Asyncs },
      { reply, { ok, Device#device.pid }, NewState };
  
  handle_call( { stop_device, Pid }, _From, State ) ->
      case orddict:find( Pid, State#state.devices ) of
          { ok, _Device } ->
              { ok, Tag } = lurch_dev:stop_async( Pid ),
              Asyncs = orddict:store( Tag, { Pid, stop }, State#state.asyncs ),
              { reply, ok, State#state{ asyncs = Asyncs } };
          error -> {reply, { error, no_such_device }, State }
      end;
  
  