Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the program to state machines #52

Open
sergey-shandar opened this issue Oct 13, 2023 · 1 comment
Open

Split the program to state machines #52

sergey-shandar opened this issue Oct 13, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sergey-shandar
Copy link
Contributor

sergey-shandar commented Oct 13, 2023

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 on async-std.

@sergey-shandar sergey-shandar changed the title Split the program to a state machine Split the program to state machines Oct 13, 2023
@sergey-shandar sergey-shandar self-assigned this Oct 13, 2023
@sergey-shandar sergey-shandar added the enhancement New feature or request label Oct 15, 2023
@sergey-shandar
Copy link
Contributor Author

sergey-shandar commented Oct 16, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant