File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,22 +115,22 @@ public function watch(Path $path): Ping
115115 #[\Override]
116116 public function temporary (Sequence $ chunks ): Attempt
117117 {
118- return Attempt::of (
119- fn () => $ this
120- ->config
121- ->io ()
122- ->files ()
123- ->temporary (
124- $ chunks ->map (
125- static fn ($ chunk ) => $ chunk
118+ return $ this
119+ ->config
120+ ->io ()
121+ ->files ()
122+ ->temporary (Sequence::of ())
123+ ->flatMap (
124+ static fn ($ tmp ) => $ chunks
125+ ->sink ($ tmp ->push ()->chunk (...))
126+ ->attempt (
127+ static fn ($ push , $ chunk ) => $ chunk
126128 ->attempt (static fn () => new \RuntimeException ('Failed to load chunk ' ))
127- ->unwrap (),
128- ),
129- )
130- ->memoize () // to make sure writing the chunks has been done
131- ->map (static fn ($ tmp ) => $ tmp ->read ())
132- ->map (Content::io (...))
133- ->unwrap (),
134- );
129+ ->flatMap ($ push )
130+ ->map (static fn () => $ push ),
131+ )
132+ ->map (static fn () => $ tmp ->read ()),
133+ )
134+ ->map (Content::io (...));
135135 }
136136}
You can’t perform that action at this time.
0 commit comments