Comments (4)
Will have a look. A test must be failing.
from reactivemongo-streaming.
I created a small play app to reproduce the behaviour: https://github.com/vdebergue/reactivemongo-test
- Using
documentSource
, it's ok with chunked and streamed entity:
% curl -v http://localhost:9000/source
> GET /source HTTP/1.1
> Host: localhost:9000
>
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=utf-8
< Date: Sun, 13 Nov 2016 21:54:58 GMT
<
1
2
3
# // connection stays opened
% curl -v http://localhost:9000/sourceStr
> GET /sourceStr HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Date: Sun, 13 Nov 2016 22:07:32 GMT
< Connection: close
<
1
2
3
# Connection kept opened
- Using
bulkSource
andOk.chunked
, connection is closed:
% curl -v http://localhost:9000/bulk
> GET /bulk HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=utf-8
< Date: Sun, 13 Nov 2016 22:00:35 GMT
<
* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining
- Using
bulkSource
and aHttpEntity.Streamed
, connection is kept opened but nothing is sent:
% curl -v http://localhost:9000/stream
* Trying ::1...
* Connected to localhost (::1) port 9000 (#0)
> GET /stream HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Date: Sun, 13 Nov 2016 22:02:09 GMT
< Connection: close
<
// kept opened
And in the console, the line Got 0 ids
keeps getting printed:
Got 0 ids
Got 0 ids
...
from reactivemongo-streaming.
To avoid having an empty chunk (from an empty result bulk) interpreted as LastChunk
, can you try the following.
def tailBulk = Action {
val source = cursor()
.bulkSource()
.map { ids =>
println(s"Got ${ids.size} ids")
"X" + ids.mkString("\n")
}
Ok.chunked(source)
}
from reactivemongo-streaming.
Seems to be an issue in play framework that doesn't interpret correctly Seq.empty
from reactivemongo-streaming.
Related Issues (15)
- Add Support for Tailable Cursors
- GraphWithMaterializedValue
- Check CircleCI caching of tooling (SSL, SBT)
- Logging in the Iteratees module
- Publish the Iteratees API doc
- the scala 3 build pulls akka-stream_2.13 and akka-actor_2.13
- Exclude tag in afterSuccess script
- pekko support? HOT 1
- Configure the Driver API URL for the doc
- Keep sending queries while the initial query result of a tailable cursor is empty. HOT 4
- Support GridFS
- Upsert Sink HOT 2
- Restore assertAllStagesClosed
- Check the scaladoc generation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactivemongo-streaming.