Open sergey-shandar opened 1 year ago
Reading:
let buf;
let write_tasks;
loop {
let task = read(len);
let new_write_tasks = handle(buf);
await write_tasks;
write_tasks = new_write_tasks;
buf = await task;
if buf.is_empty() {
break;
}
}
write_taks = end();
await write_tasks;
Currently, we use
push_ireator
instead of a formal state machine.It will allow us to switch to asynchronous I/O.
According to this post, we may use
async-std
instead of Tokyo. To avoid dependencies, we can split the project to two parts: a library and CLI. CLI will depend onasync-std
.