Ditch ResumableSource
This commit is contained in:
parent
103c098cf8
commit
3bb654857c
@ -277,7 +277,7 @@ getPerson :: Manager -> Token -> HandlerT site IO (Maybe Person)
|
|||||||
getPerson manager token = parseMaybe parseJSON <$> (do
|
getPerson manager token = parseMaybe parseJSON <$> (do
|
||||||
req <- personValueRequest token
|
req <- personValueRequest token
|
||||||
res <- http req manager
|
res <- http req manager
|
||||||
responseBody res $$+- sinkParser json'
|
responseBody res $$ sinkParser json'
|
||||||
)
|
)
|
||||||
|
|
||||||
personValueRequest :: MonadIO m => Token -> m Request
|
personValueRequest :: MonadIO m => Token -> m Request
|
||||||
|
|||||||
@ -61,10 +61,9 @@ import Data.Monoid (mempty)
|
|||||||
#endif
|
#endif
|
||||||
import Text.Hamlet (Html)
|
import Text.Hamlet (Html)
|
||||||
import Text.Blaze.Html.Renderer.Utf8 (renderHtmlBuilder)
|
import Text.Blaze.Html.Renderer.Utf8 (renderHtmlBuilder)
|
||||||
import Data.Conduit (Flush (Chunk), ResumableSource, mapOutput)
|
import Data.Conduit (Flush (Chunk), SealedConduitT, mapOutput)
|
||||||
import Control.Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
import Control.Monad.Trans.Resource (ResourceT)
|
import Control.Monad.Trans.Resource (ResourceT)
|
||||||
import Data.Conduit.Internal (ResumableSource (ResumableSource))
|
|
||||||
import qualified Data.Conduit.Internal as CI
|
import qualified Data.Conduit.Internal as CI
|
||||||
|
|
||||||
import qualified Data.Aeson as J
|
import qualified Data.Aeson as J
|
||||||
@ -122,8 +121,8 @@ instance ToFlushBuilder builder => ToContent (CI.Pipe () () builder () (Resource
|
|||||||
|
|
||||||
instance ToFlushBuilder builder => ToContent (CI.ConduitT () builder (ResourceT IO) ()) where
|
instance ToFlushBuilder builder => ToContent (CI.ConduitT () builder (ResourceT IO) ()) where
|
||||||
toContent src = ContentSource $ mapOutput toFlushBuilder src
|
toContent src = ContentSource $ mapOutput toFlushBuilder src
|
||||||
instance ToFlushBuilder builder => ToContent (ResumableSource (ResourceT IO) builder) where
|
instance ToFlushBuilder builder => ToContent (SealedConduitT () builder (ResourceT IO) ()) where
|
||||||
toContent (ResumableSource src) = toContent src
|
toContent (CI.SealedConduitT src) = toContent src
|
||||||
|
|
||||||
-- | A class for all data which can be sent in a streaming response. Note that
|
-- | A class for all data which can be sent in a streaming response. Note that
|
||||||
-- for textual data, instances must use UTF-8 encoding.
|
-- for textual data, instances must use UTF-8 encoding.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user