diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-12 09:55:06 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-12 09:55:06 +0100 |
commit | 63f705792e1e5abf6b8fe9211a10815d3478e21a (patch) | |
tree | e0ef80485698bd7e61c0fec25d66b2f1f0b4f434 /Cargo.toml | |
parent | 35691c3bd2911c9fa690c08a17012f89c9ee199b (diff) |
Fix: Spawn filesystem task on a blocking tokio thread
This patch changes the (possibly heavy) File reading from disk to be executed on
a blocking tokio thread.
This way, we ensure we do not block until the `read()` operation is finished and
can continue executing async tasks on the runtime.
Because IO might be expensive (think of a 5GB file that is read to memory), this
is a good optimization.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'Cargo.toml')
-rw-r--r-- | Cargo.toml | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -42,7 +42,7 @@ shiplift = { git = "https://github.com/softprops/shiplift", rev = "03cc8c0 syntect = "4.4" tar = "0.4" terminal_size = "0.1" -tokio = { version = "0.2", features = ["macros", "fs", "process", "io-util"] } +tokio = { version = "0.2", features = ["macros", "fs", "process", "io-util", "blocking"] } toml = "0.5" typed-builder = "0.7" unindent = "0.1" |