[2/9] docs: add Backend enum tests and documentation#106
[2/9] docs: add Backend enum tests and documentation#106ElFantasma merged 5 commits intolambdaclass:mainfrom
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.
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
Summary
Add comprehensive tests and documentation for the Backend enum.
Tests (10 new tests)
Documentation
~300 lines
Dependencies
Test plan
🤖 Generated with Claude Code