[JAVA-3430] Refine binary stream interchange in GridFS Created: 17/Jan/19 Updated: 28/Oct/23 Resolved: 13/Dec/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Reactive Streams |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Mark Paluch | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
AsyncInputStream is somewhat unusual in its semantics. From the interface description, it's hard to reason how the API is supposed to work. That should be probably clarified in the documentation. I propose a simpler mechanism to consume a binary stream by using Publisher<ByteBuffer>. Consuming GridFs through Publisher<ByteBuffer> comes with the following characteristics:
An unsolved issue remains with pooled buffers as AsyncInputStream allows copying source content onto the provided ByteBuffer and releasing the source before emitting the written byte count. Maybe extending the concept to Publisher<T> and BiConsumer<T, ByteBuffer> (a copy/mapping function) could work. Thoughts? |
| Comments |
| Comment by Githook User [ 15/Jan/20 ] |
|
Author: {'name': 'Ross Lawley', 'username': 'rozza', 'email': 'ross.lawley@gmail.com'}Message: GridFS API improvements
|
| Comment by Ross Lawley [ 11/Dec/19 ] |
| Comment by Ross Lawley [ 26/Nov/19 ] |
|
Added JAVARS-222 to handle the pre 4.x work |
| Comment by Jeffrey Yemin [ 20/Nov/19 ] |
|
ross.lawley. we can use this ticket for the 4.x port, but we should have a JAVARS ticket for the 1.13 work. |
| Comment by Ross Lawley [ 20/Nov/19 ] |
|
PR: https://github.com/rozza/mongo-java-driver-reactivestreams/pull/21 |
| Comment by Mark Paluch [ 28/Jan/19 ] |
|
I linked the Spring Data MongoDB integration that accepts and exposes binary streams through a Reactive Streams Publisher. |