o
  atomically $ do
    next ← readTChan action
    let result = dispatch resources next
    writeTChan response result
  dispatchFromChan resources action response

-- Start a checker thread for a given mod. The first TChan is used to send check
-- requests to the thread, while the second is used to send results back
startCheck :: Resources → IO (TChan Action, TChan T.Text)
startCheck resources = do
  action ← atomically newTChan
  resp
dispatchFromChan :: Resources → TChan Action → TChan T.Text → IO ()
dispatchFromChan resources action response = do
  atomically $ do
    next ← readTChan action
    let result = dispatch resources next
    writeTChan response result
  dispatchFromChan resources action response

-- Start a checker thread for a given mod. The first TChan is used to send check
-- requests to the thread, while the second is used to send results back
dispatchFromChan resources action response = do
  atomically $ do
    next ← readTChan action
    let result = dispatch resources next
    writeTChan response result
  dispatchFromChan resources action response

-- Start a checker thread for a given mod. The first TChan is used to send check
-- requests to the thread, while the second is used to send results back