Documentation

ParallelTransfer extends AbstractTransfer
in package

Transfers multipart upload parts in parallel

Table of Contents

Constants

AFTER_ABORT  = 'multipart_upload.after_abort'
AFTER_COMPLETE  = 'multipart_upload.after_complete'
AFTER_PART_UPLOAD  = 'multipart_upload.after_part_upload'
AFTER_UPLOAD  = 'multipart_upload.after_upload'
BEFORE_PART_UPLOAD  = 'multipart_upload.before_part_upload'
BEFORE_UPLOAD  = 'multipart_upload.before_upload'
MAX_PART_SIZE  = 5368709120
MAX_PARTS  = 10000
MIN_PART_SIZE  = 5242880

Properties

$client  : AwsClientInterface
$eventDispatcher  : EventDispatcherInterface
$options  : array<string|int, mixed>
$partSize  : int
$source  : EntityBody
$state  : TransferStateInterface
$stopped  : bool

Methods

__construct()  : mixed
Construct a new transfer object
__invoke()  : mixed
abort()  : Model
Abort the upload
addSubscriber()  : self
Add an event subscriber to the dispatcher
dispatch()  : Event
Helper to dispatch Guzzle events and set the event name on the event
getAllEvents()  : array<string|int, mixed>
Get a list of all of the events emitted from the class
getEventDispatcher()  : EventDispatcherInterface
Get the EventDispatcher of the request
getOptions()  : array<string|int, mixed>
Get the array of options associated with the transfer
getSource()  : EntityBodyInterface
Get the source body of the upload
getState()  : TransferStateInterface
Get the current state of the upload
setEventDispatcher()  : self
Set the EventDispatcher of the request
setOption()  : self
Set an option on the transfer
stop()  : TransferStateInterface
Stop the transfer and retrieve the current state.
upload()  : Model|null
Upload the source to using a multipart upload
calculatePartSize()  : int
Determine the upload part size based on the size of the source data and taking into account the acceptable minimum and maximum part sizes.
complete()  : Model
Complete the multipart upload
getAbortCommand()  : OperationCommand
Fetches the abort command fom the concrete implementation
getEventData()  : array<string|int, mixed>
Get an array used for event notifications
init()  : mixed
Hook to initialize the transfer
prepareParts()  : array<string|int, mixed>
Prepare the entity body handles to use while transferring
transfer()  : mixed
Hook to implement in subclasses to perform the actual transfer

Constants

AFTER_COMPLETE

public mixed AFTER_COMPLETE = 'multipart_upload.after_complete'

AFTER_PART_UPLOAD

public mixed AFTER_PART_UPLOAD = 'multipart_upload.after_part_upload'

AFTER_UPLOAD

public mixed AFTER_UPLOAD = 'multipart_upload.after_upload'

BEFORE_PART_UPLOAD

public mixed BEFORE_PART_UPLOAD = 'multipart_upload.before_part_upload'

BEFORE_UPLOAD

public mixed BEFORE_UPLOAD = 'multipart_upload.before_upload'

Properties

$options

protected array<string|int, mixed> $options

Associative array of options

$stopped

protected bool $stopped = false

Whether or not the transfer has been stopped

Methods

abort()

Abort the upload

public abort() : Model
Return values
Model

Returns the result of the abort multipart upload command

dispatch()

Helper to dispatch Guzzle events and set the event name on the event

public dispatch(mixed $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
$eventName : mixed

Name of the event to dispatch

$context : array<string|int, mixed> = array()

Context of the event

Return values
Event

Returns the created event object

getAllEvents()

Get a list of all of the events emitted from the class

public static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOptions()

Get the array of options associated with the transfer

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

setOption()

Set an option on the transfer

public setOption(string $option, mixed $value) : self
Parameters
$option : string

Name of the option

$value : mixed

Value to set

Return values
self

upload()

Upload the source to using a multipart upload

public upload() : Model|null
Tags
throws
MultipartUploadException

when an error is encountered. Use getLastException() to get more information.

throws
RuntimeException

when attempting to upload an aborted transfer

Return values
Model|null

Result of the complete multipart upload command or null if uploading was stopped

calculatePartSize()

Determine the upload part size based on the size of the source data and taking into account the acceptable minimum and maximum part sizes.

protected calculatePartSize() : int
Return values
int

The part size

complete()

Complete the multipart upload

protected complete() : Model
Return values
Model

Returns the result of the complete multipart upload command

getEventData()

Get an array used for event notifications

protected getEventData([OperationCommand $command = null ]) : array<string|int, mixed>
Parameters
$command : OperationCommand = null

Command to include in event data

Return values
array<string|int, mixed>

prepareParts()

Prepare the entity body handles to use while transferring

protected prepareParts(int $concurrency) : array<string|int, mixed>
Parameters
$concurrency : int

Number of parts to prepare

Return values
array<string|int, mixed>

Parts to send

transfer()

Hook to implement in subclasses to perform the actual transfer

protected transfer() : mixed

        
On this page

Search results