Add the possibility to implement a callback after each file transfer is fulfilled when using the Transfer class in S3 #2725
Labels
feature-request
A feature should be added or improved.
p2
This is a standard priority issue
queued
This issues is on the AWS team's backlog
Describe the feature
The SDK offers the possibility to transfer files to and from an S3 Object Storage using the Transfer class.
Currently it is possible to implement a callback before each Command is executed but there is no possibility of implementing a callback after the Command has been executed.
Example of the "before" callback:
I would like to request the feature that we could write another type of callback to be executed "after" the command is executed.
Such a feature would be easy to implement with a minimum amount of changes and would open more of the S3 transfer SDK possibilities.
Use Case
As I had to implement a buffered S3 client (the buffer being represented by saving files on disk before they will be transferred to S3 later on) I could not easily cleanup the files that were already transferred because there is no "after" callback function.
With the proposed solution one could use something like:
Proposed Solution
Implementing an "after" callback in a similar way to how the "before" callback is working now.
Basically sending a callable as part of the options parameter to the existing functions.
For the upload methods the callable would just need to be passed further to the
Promise\Each::ofLimitAll
as the 3rd parameter (onFulfilled) when creating the upload promise.For the download methods the callable would just need to be sent as part of the
CommandPool
constructor options asfulfill
.Other Information
No response
Acknowledgements
SDK version used
3.275.6
Environment details (Version of PHP (
php -v
)? OS name and version, etc.)PHP 7.2.24-0ubuntu0.18.04.17
The text was updated successfully, but these errors were encountered: