Skip to content

Commit

Permalink
Support multiple messages per chunk in streaming image pull (softprop…
Browse files Browse the repository at this point in the history
  • Loading branch information
aluminous authored and softprops committed Feb 25, 2019
1 parent 0ae953c commit ad95d93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib.rs
Expand Up @@ -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,
Expand Down

0 comments on commit ad95d93

Please sign in to comment.