node: Constrain worker channel size
To avoid buffering large amounts of data in the process, we set the
worker channel size to 1. Keep in mind that this is one
ChannelEvent, not one byte. ChannelEvent::Data can already contain
an arbitrary amount of data via its Vec<u8>.
This forces the worker to block as long as no one is reading data on the other side.
We also remove an unused function, and move the flushing to the
ChannelFlushWriter.
2 files changed
+5
-20
38592955
→
a79ca5e8
modified radicle-node/src/worker/channels.rs
@@ -10,7 +10,9 @@ use crate::runtime::Handle;
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -184,7 +186,7 @@ struct ChannelWriter<T = Vec<u8>> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -206,29 +208,13 @@ impl Write for ChannelFlushWriter<Vec<u8>> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
|
|
|
|
|
modified radicle-node/src/worker/upload_pack.rs
@@ -201,7 +201,6 @@ where
|
|
|
|
|
|
| - | |
|
|
|
|
|