eyre'
  :: (HasPierEnv e, HasMultiEyreApi e)
  => Ship
  -> Bool
  -> (Text -> RIO e ())
  -> KingSubsite
  -> RIO e ([Ev], RAcquire e (DriverApi HttpServerEf))

eyre' who isFake stderr sub = do
  ventQ :: TQueue EvErr <- newTQueueIO
  env <- ask

  let (bornEvs, startDriver) =
        eyre env who (writeTQueue ventQ) isFake stderr sub

  let runDriver = do
        diOnEffect <- startDriver
        let diEventSource = fmap RRWork <$> tryReadTQueue ventQ
        pure (DriverApi {..})

  pure (bornEvs, runDriver)

{-|
  Eyre -- HTTP Server Driver

  Inject born events.
  Until born events succeeds, ignore effects.
  Wait until born event callbacks invoked.
    If success, signal success.
    If failure, try again several times.
      If still failure, bring down ship.
   Once born event succeeds:
     - Begin normal operation (start accepting requests)
-}
eyre'
  :: (HasPierEnv e, HasMultiEyreApi e)
  => Ship
  -> Bool
  -> (Text -> RIO e ())
  -> KingSubsite
  -> RIO e ([Ev], RAcquire e (DriverApi HttpServerEf))
eyre' who isFake stderr sub = do
  ventQ :: TQueue EvErr <- newTQueueIO
  env <- ask

  let (bornEvs, startDriver) =
        eyre env who (writeTQueue ventQ) isFake stderr sub

  let runDriver = do
        diOnEffect <- startDriver
        let diEventSource = fmap RRWork <$> tryReadTQueue ventQ
        pure (DriverApi {..})

  pure (bornEvs, runDriver)

{-|
  Eyre -- HTTP Server Driver

  Inject born events.
  Until born events succeeds, ignore effects.
  Wait until born event callbacks invoked.
    If success, signal success.
    If failure, try again several times.
      If still failure, bring down ship.
   Once born event succeeds:
     - Begin normal operation (start accepting requests)
-}
eyre' who isFake stderr sub = do
  ventQ :: TQueue EvErr <- newTQueueIO
  env <- ask

  let (bornEvs, startDriver) =
        eyre env who (writeTQueue ventQ) isFake stderr sub

  let runDriver = do
        diOnEffect <- startDriver
        let diEventSource = fmap RRWork <$> tryReadTQueue ventQ
        pure (DriverApi {..})

  pure (bornEvs, runDriver)

{-|
  Eyre -- HTTP Server Driver

  Inject born events.
  Until born events succeeds, ignore effects.
  Wait until born event callbacks invoked.
    If success, signal success.
    If failure, try again several times.
      If still failure, bring down ship.
   Once born event succeeds:
     - Begin normal operation (start accepting requests)
-}