-
Notifications
You must be signed in to change notification settings - Fork 5
[2/9] docs: add Backend enum tests and documentation #106
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
[2/9] docs: add Backend enum tests and documentation #106
Conversation
concurrency/src/tasks/gen_server.rs
Outdated
| /// - Should not compete with other blocking tasks | ||
| /// - Run CPU-intensive workloads | ||
| /// | ||
| /// Each GenServer gets its own thread, providing complete isolation from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not true: GenServer::start(Backend::Thread) uses GenServerHandle::new_on_thread which end's up creating a new Runtime (currently a tokio Runtime) in a dedicated OS thread. While this isolates it from other tasks in other threads, it still needs the async runtime. And I believe it currently needs some fine tuning and testing, as it is started via Runtime::new() which creates a multi_thread Runtime (probably unnecessary for this case) with all features enabled (which should be reviewed).
|
This and the previous PR confuses between
Both exist separately because even when their APIs are similar, the first one has some |
Add 10 new tests covering: - Backend enum traits (Default, Copy, Clone, Debug, PartialEq, Eq) - All three backends handle call/cast correctly - Backend::Thread isolates blocking work from async runtime - Multiple backends can run concurrently with independent state - Backend::default() works in start()
Document each backend option with: - Comparison table showing execution model, best use cases, and limitations - Code examples for each backend - Detailed "When to Use" guide with advantages and avoid-when advice - Per-variant documentation with specific use cases
3e8da1d to
c13e31f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will approve and merge this one, it LGTM.
Summary
Add comprehensive tests and documentation for the Backend enum.
Tests (10 new tests)
Documentation
~300 lines
Dependencies
Test plan
🤖 Generated with Claude Code