Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Streaming HTTP responses documentation #6627

Merged
merged 2 commits into from Oct 7, 2016

Conversation

Projects
None yet
4 participants
@mrsushil118
Copy link

commented Oct 7, 2016

Pull Request Checklist

  • Have you read How to write the perfect pull request?
  • Have you read through the contributor guidelines?
  • Have you signed the Lightbend CLA?
  • Have you [squashed your commits]? (Optional, but makes merge messages nicer.)
  • Have you added copyright headers to new files?
  • Have you checked that both Scala and Java APIs are updated?
  • Have you updated the documentation for both Scala and Java sections?
  • Have you added tests for any changed functionality?

Helpful things

Fixes

Fixes #xxxx

Purpose

Updated Streaming HTTP responses documentation with new API to create a Result object directly and choose an HttpEntity to represent its body.

Background Context

@lightbend-cla-validator

This comment has been minimized.

Copy link

commented Oct 7, 2016

Hi @mrsushil118,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@mrsushil118 mrsushil118 changed the title Updated Streaming HHTP responses documentation Updated Streaming HTTP responses documentation Oct 7, 2016

@mrsushil118

This comment has been minimized.

Copy link
Author

commented Oct 7, 2016

I have signed the Lightbend CLA.

@julienrf
Copy link
Contributor

left a comment

Thanks a lot! I think that it would be better if you completely remove all mentions of Enumerators. Also, would you mind moving this code to actual source files?


```scala
val file = new java.io.File("/tmp/fileToServe.pdf")
val fileContent: Enumerator[Array[Byte]] = Enumerator.fromFile(file)
val fileContent: Enumerator[ByteString] = Enumerator.fromFile(file).map(byteArray => ByteString(byteArray))
val source: Source[ByteString, _] = Source.fromPublisher(Streams.enumeratorToPublisher(fileContent))

This comment has been minimized.

Copy link
@julienrf

julienrf Oct 7, 2016

Contributor

I would recommend using FileIO instead of going through an Enumerator.

This comment has been minimized.

Copy link
@mrsushil118

mrsushil118 Oct 7, 2016

Author

Sure @julienrf, I have completely removed all mentions of Enumerator and used FileIO in it's place.
I also updated the Chunked Responses with Akka Streams Source object for the stream of chunks.

Sushil
Updated Streaming HTTP responses documentation
Used FileIO instead of going through an Enumerator.
Updated chunked response documentation using Source.
@julienrf

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2016

Thanks, looks good to me!

@gmethvin gmethvin merged commit b5ce7a4 into playframework:master Oct 7, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
typesafe-cla-validator All users have signed the CLA
Details

gmethvin added a commit that referenced this pull request Oct 7, 2016

Updated Streaming HTTP responses documentation (#6627)
Updated Streaming HTTP responses documentation
Used FileIO instead of going through an Enumerator.
Updated chunked response documentation using Source.

@mrsushil118 mrsushil118 deleted the mrsushil118:doc_correction branch Oct 12, 2016

wsargent pushed a commit to wsargent/playframework that referenced this pull request Oct 18, 2016

Sushil Kumar Will Sargent
Updated Streaming HTTP responses documentation (playframework#6627)
Updated Streaming HTTP responses documentation
Used FileIO instead of going through an Enumerator.
Updated chunked response documentation using Source.

wsargent added a commit to wsargent/playframework that referenced this pull request Oct 25, 2016

Updated Streaming HTTP responses documentation (playframework#6627)
Updated Streaming HTTP responses documentation
Used FileIO instead of going through an Enumerator.
Updated chunked response documentation using Source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.