anchor.diff:      , driver     :: binary()
       , parameters :: [ binary() ]
       , events     :: [ binary() ]
  +    , state      :: starting | running | stopping
       } ).
   
   -record( state,
       { devices = orddict:new() :: orddict:orddict()
  -    , polls = [] :: list( lurch_dev:msg_tag() )
  -    , starts = [] :: list( lurch_dev:msg_tag() )
  +    , asyncs = orddict:new() :: orddict:orddict()
       } ).
   
   
  
positive.code:     Driver = proplists:get_value(driver, Configuration),
      Parameters = proplists:get_value(parameters, Configuration),
      Events = proplists:get_value(events, Configuration, []),
      % FIXME - lurch_dev:start_async
      %{ ok, Pid, Tag } = lurch_dev:start_async( Driver, Parameters ),
      case lurch_dev:start( Driver, Parameters ) of
          { ok, Pid } ->
              Device = #device{ pid = Pid
                              , driver = Driver
                              , parameters = Parameters
                              , events = Events },
              Devices = orddict:store( Pid, Device, State#state.devices ),
              NewState = State#state{ devices = Devices },
              { reply, { ok, Device#device.pid }, NewState };
          { error, _ } = Error ->
              { reply, Error, State }
      end;
  
  handle_call( { stop_device, Pid }, _From, State ) ->
      case orddict:find( Pid, State#state.devices ) of
          { ok, Device } ->
              lurch_dev:stop( Device#device.pid ),
              NewDevices = orddict:erase( Pid, State#state.devices ),
              NewState = State#state{ devices = NewDevices },
              { reply, ok, NewState };
          error -> {reply, { error, no_such_device }, State }
      end;
  
  
negative.code:     case device_event_exists( Pid, Event, State#state.devices ) of
          ok ->
              { ok, Tag } = lurch_dev:request_event_async( Pid, Event ),
              Asyncs = orddict:store( Tag, { Pid, poll }, State#state.asyncs ),
              { noreply, State#state{ asyncs = Asyncs } };
          _ ->
              % FIXME - log?
              { noreply, State }
  