class EasyAwscr::S3::Internals::SyncChunkUploader

Overview

If performance is relevant, AsyncChunkUploader should be much better. However, this implementation is straightforward; benefits are blocking behavior and minimal memory overhead. It can also be useful for debugging purposes, since it avoids a lot of complexity of the other multi-worker implementation.

Defined in:

easy-awscr/s3/internals/sync_chunk_uploader.cr

Constructors

Instance Method Summary

Instance methods inherited from class EasyAwscr::S3::Internals::ChunkedIO::Handler

close : Nil close, open : Nil open, write(buffer : IO::Memory) : IO::Memory | Nil write

Constructor Detail

def self.new(client : Client, bucket : String, object : String, headers : Hash(String, String) = Hash(String, String).new) #

[View source]

Instance Method Detail

def close : Nil #
Description copied from class EasyAwscr::S3::Internals::ChunkedIO::Handler

Will be called once after the last write operation.


[View source]
def open : Nil #
Description copied from class EasyAwscr::S3::Internals::ChunkedIO::Handler

Will be called once before the first write operation.


[View source]
def write(buffer : IO::Memory) : IO::Memory | Nil #
Description copied from class EasyAwscr::S3::Internals::ChunkedIO::Handler

Can be called multiple times. The input is the current chunk. The implementer can either process it synchronously or asynchronously. Optionally, the function can return a buffer (either the input buffer or another buffer of equal size) that the ChunkedIO class can reuse. However, it is always safe to return nil and let the class reallocate a new buffer instead.


[View source]