procLoop lock gasupply =
    do bracket dbconnect disconnect (\c -> do
         i <- popItem lock gasupply c
         procLoop' lock gasupply c i
                                    )


{- | Main worker loop.  We receive an item and process it.  If it's
Nothing, there is nothing else to do, so the thread shuts down. 
Otherwise, call procItem, pop the next, and then call itself. -}
procLoop lock gasupply =
    do bracket dbconnect disconnect (\c -> do
         i <- popItem lock gasupply c
         procLoop' lock gasupply c i
                                    )


{- | Main worker loop.  We receive an item and process it.  If it's
Nothing, there is nothing else to do, so the thread shuts down. 
Otherwise, call procItem, pop the next, and then call itself. -}
procLoop lock gasupply =
    do bracket dbconnect disconnect (\c -> do
         i <- popItem lock gasupply c
         procLoop' lock gasupply c i
                                    )


{- | Main worker loop.  We receive an item and process it.  If it's
Nothing, there is nothing else to do, so the thread shuts down. 
Otherwise, call procItem, pop the next, and then call itself. -}