Struct ciruela::cluster::Connection[][src]

pub struct Connection { /* fields omitted */ }

Connection to a server or cluster of servers

Ciruela automatically manages a number of connections according to configs and the operations over connection (i.e. images currently uploading).

Methods

impl Connection
[src]

Create a connection pool object

Warning: constructor should run on loop provieded by tk_easyloop. In future, tokio will provide implicit loop reference on it's own.

The actual underlying connections are established when specific operation is requested. Also you don't need to specify all node name in the cluster, they will be discovered.

There are two common patterns:

  1. [preferred] Use a DNS name that resolves to a full list of IP addresses. Common DNS servers randomize them and only spill few of the adressses because of DNS package size limit, but that's fine, as we only need 3 or so of them.
  2. Specify 3-5 server names and leave the discover to ciruela itself.

While you can specify a name that refers to only one address, it's not a very good idea (unless you really have one server) because the server you're connecting to may fail.

Initiate a new upload (appending a directory)

Panics

If connection set is already closed

Initiate a new upload (appending a directory, if not exists)

This is basically same as 'append()` but ignores errors when directory already exists (or currently downloading) but has different contents.

Panics

If connection set is already closed

Initiate a new upload (replacing a directory)

Panics

If connection set is already closed

Initiate a new upload (replacing if directory hash matches)

Panics

If connection set is already closed

Fetch index of a directory that is currently on the server

Fetch file relative to the index

Panics

Panics if there is no such file in the index

Trait Implementations

impl Debug for Connection
[src]

Formats the value using the given formatter. Read more

impl Clone for Connection
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Connection

impl Sync for Connection