Struct ciruela::blocks::ThreadedBlockReader [] [src]

pub struct ThreadedBlockReader { /* fields omitted */ }

A default threaded block reader

It starts 40 threads (by default) and reads every block requested from server. The number of threads is large to allow disk subsystem to reorder and optimize requests. Threads should be quite cheap in rust.

Note: no prefetching or caching blocks implemented because it's expected that servers request different blocks. Also, we don't know which blocks will be requested because in the average case most blocks are already on server because of similar images. Also, OS file cache is good enough.

Methods

impl ThreadedBlockReader
[src]

[src]

Create a reader with default number of threads (40 at the moment)

[src]

Create a reader with specified number of threads

[src]

Register a filesystem directory to respond to get_block request from

[src]

Register some data that will be served from memory

Data will be provided by hashes, so isn't tied to any index or path

Trait Implementations

impl Debug for ThreadedBlockReader
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for ThreadedBlockReader
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl GetBlock for ThreadedBlockReader
[src]

A block data returned Read more

Error returned by future Read more

Future returned by read_block

[src]

Read block by hash

Auto Trait Implementations