Analyze concurrency model and add use case documentation#26
Merged
Conversation
This commit addresses several aspects related to understanding and documenting Shifty's concurrency model and use cases:
1. **Code Comments on Fiber Usage:**
I added detailed comments to `lib/shifty/worker.rb` to explain:
* The Fiber-based cooperative multitasking approach.
* Its single-threaded nature.
* Rationale for this choice (simplicity for data pipelines).
* Brief comparison with Threads/Ractors.
* Thread-safety considerations for Shifty components.
2. **New Use Cases Document:**
I created `docs/use_cases.md` to outline:
* Ideal scenarios for using Shifty (data processing, ETL-like tasks).
* Conceptual examples to illustrate its application.
3. **README Update:**
I added a "Concurrency Model" section to `README.md` that:
* Briefly explains the Fiber-based model.
* Links to the new `docs/use_cases.md` for further details.
These changes aim to improve the understanding of Shifty's design for both maintainers and you, and to provide clarity on how it can be effectively utilized.
Distinguish preemptive concurrency hazards (removed by single-threading) from data-mutation hazards across handoffs (not removed); reframe the Threads/Ractors note as a scoping decision that is Ractor-compatible; and scope the thread-safety caveat to worker/pipeline objects and closure state. Forward-reference docs/planning/handoff-immutability-policies.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses several aspects related to understanding and documenting Shifty's concurrency model and use cases:
Code Comments on Fiber Usage: I added detailed comments to
lib/shifty/worker.rbto explain:New Use Cases Document: I created
docs/use_cases.mdto outline:README Update: I added a "Concurrency Model" section to
README.mdthat:docs/use_cases.mdfor further details.These changes aim to improve the understanding of Shifty's design for both maintainers and you, and to provide clarity on how it can be effectively utilized.