async-rs / async-rs/async-std

Book: naming convention for loop functions

Open
#106 5 comments 0 reactions 1 assignee Claimed by @matklad View on GitHub
documentation
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

There are quite a few functions in the book that runs `while` loop inside as are supposed to be called instead `task::spawn`. E.g. `server`, `client`, `client_writer`. I think it makes sense to extend those name to explicitly set expectation on loop inside it, like `server_loop`, `client_loop`, `client_writer_loop`. Would be happy to provide PR if that sounds like a helpful change.

Another thought about naming, `client` function technically is not about "client", it's about "connection". Maybe it should be `connection_loop`? It makes disconnect handling easier to read.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.