Top.Mail.Ru
Module cartridge.upload | Tarantool
 
Tarantool Cartridge / Table of contents / Module cartridge.upload
Tarantool Cartridge / Table of contents / Module cartridge.upload

Module cartridge.upload

Module cartridge.upload

Spread the data across instances in a network-efficient manner.

(Added in v2.4.0-43)

Spread the data across the cluster.

For each separate upload, a random upload_id is generated. All the instances try to create /tmp/<upload_id> on their side, and those who succeed act as transmitters.

When the upload finishes, all the instances load the data into the inbox table and the temporary files are cleared. The inbox isn’t garbage-collected automatically. It’s the user’s responsibility to clean it up after use.

Parameters:

  • data: any Lua object.
  • uri_list: ({string,…}) array of URIs.

Returns:

(string) upload_id (if at least one upload succeded)

Or

(nil)

(table) Error description

The uploaded data. {[upload_id] = data}