Skip to content

Commit

Permalink
run parse asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed May 17, 2024
1 parent de5641c commit 3d58b32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ trait ArgonautSupport {
* unmarshaller for any `A` value
*/
implicit def fromByteStringUnmarshaller[A: DecodeJson]: Unmarshaller[ByteString, A] =
Unmarshaller(_ => bs => Future.successful(decode(parse(bs.utf8String))))
Unmarshaller(ec => bs => Future(decode(parse(bs.utf8String)))(ec))

/**
* HTTP entity => `Source[A, _]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ trait JacksonSupport {
def unordered =
Flow[ByteString].mapAsyncUnordered(support.parallelism)(asyncParse)

FastFuture.successful {
Future.successful {
entity.dataBytes
.via(support.framingDecoder)
.via(if (support.unordered) unordered else ordered)
Expand Down

0 comments on commit 3d58b32

Please sign in to comment.