diff options
author | Austin Brown <austin@alumino.us> | 2019-02-25 23:26:36 +0900 |
---|---|---|
committer | doug tangren <d.tangren@gmail.com> | 2019-02-25 09:26:36 -0500 |
commit | ad95d93204cc84cc4648a1defac786db3ddd8582 (patch) | |
tree | d5ff3ee3a8f09ed4dcb9db115fea7ffe676a64ea | |
parent | 0ae953c69ce7a336794244adc29bbc206320705d (diff) |
Support multiple messages per chunk in streaming image pull (#154)
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -197,7 +197,15 @@ impl<'a> Images<'a> { self.docker .stream_post::<Body>(&path.join("?"), None) // todo: give this a proper enum type - .and_then(|r| serde_json::from_slice::<Value>(&r[..]).map_err(Error::from)) + .map(|r| { + futures::stream::iter_result( + serde_json::Deserializer::from_slice(&r[..]) + .into_iter::<Value>() + .collect::<Vec<_>>(), + ) + .map_err(Error::from) + }) + .flatten() } /// exports a collection of named images, |