feat(storage): Expose Flush() in AsyncWriter by shubham-up-47 · Pull Request #15555 · googleapis/google-cloud-cpp

This change introduces a Flush() method to the AsyncWriter class, providing users with more control over the asynchronous upload process. If multiple Flush() calls are made, they are queued and processed sequentially. Each call returns a future that will be satisfied only when that specific flush operation (and all preceding ones) have been acknowledged by the service.

For unbuffered (StartUnbufferedUpload) and appendable (StartAppendableObjectUpload) uploads, this is implemented using a promise queue to serialize flush operations, ensuring thread safety for concurrent use. For buffered uploads (StartBufferedUpload), the Flush() method currently forwards to Write(). A more complete implementation that forces the buffer to be sent and handles concurrent calls correctly is planned for a follow-up PR.


This change is Reviewable