luckyframework / luckyframework/lucky
Handle current fiber data per request
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 2.7k
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
Related: https://github.com/luckyframework/avram/issues/804
It's not always the case, but it is technically possible for 2 requests to use the same Fiber instance. Breeze also patches Fiber
This is used so we can track information per request to store in Breeze.
One nice thing that Athena is doing is creating this object inside of a handler to ensure each request sets that value on the current fiber regardless of if the fiber is the same from the previous request.
I think we should create something similar, and then any time we need to patch Fiber, we would actually just patch this "container" object. Then that would be set in some handler to guarantee it's consistent. Maybe the request id handler could be merged, and then stored on this thing? 🤷♂️
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the referenced Breeze implementation in src/charms/fiber.cr with Athena's handler code in src/components/framework/src/athena.cr. Trace Lucky's request-scoped data and request-id handling, then determine how reused Fiber instances should be covered. Done means request data is isolated per request, with tests demonstrating safe behavior when a Fiber is reused.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- backend, web-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100