File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
rest/.jvm/src/main/scala/io/udash/rest Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -150,17 +150,17 @@ class RestServlet(
150150 case binary : StreamedBody .RawBinary =>
151151 response.setContentType(binary.contentType)
152152 binary.content
153- .consumeWith( Consumer .foreach { chunk =>
153+ .foreachL { chunk =>
154154 response.getOutputStream.write(chunk)
155155 response.getOutputStream.flush()
156- })
156+ }
157157 case jsonList : StreamedBody .JsonList =>
158158 response.setContentType(jsonList.contentType)
159159 jsonList.elements
160160 .bufferTumbling(jsonList.customBatchSize.getOrElse(defaultStreamingBatchSize))
161161 .switchIfEmpty(Observable (Seq .empty))
162162 .zipWithIndex
163- .consumeWith( Consumer .foreach { case (batch, idx) =>
163+ .foreachL { case (batch, idx) =>
164164 val firstBatch = idx == 0
165165 if (firstBatch) {
166166 response.getOutputStream.write(" [" .getBytes(jsonList.charset))
@@ -176,7 +176,7 @@ class RestServlet(
176176 response.getOutputStream.write(e.value.getBytes(jsonList.charset))
177177 }
178178 response.getOutputStream.flush()
179- })
179+ }
180180 .map(_ => response.getOutputStream.write(" ]" .getBytes(jsonList.charset)))
181181 }
182182 }.onErrorHandle {
You can’t perform that action at this time.
0 commit comments