softwaremill / softwaremill/sttp
Confusing ArmeriaCatsBackend initialization
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 338
- Avg merge
- 8h 59m
- Merged PRs (30d)
- 13
Description
ArmeriaCatsBackend can be created with apply and then closeFactory will be true, but if it is created with usingClient or usingDefaultClient then closeFactory isfalse.
I don't know how to interpret it and what was the motivation behind it.
What I wanted to do is to create a method that would return SttpBackend with all the needed decorations of WebClient, but it's only possible to do it with usingClient which has closeFactory set to false.
And there's currently no workaround for it, because both constructor and apply method are private
Contributor guide
No contributing guide indexed for this repository
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
Start by reading the ArmeriaCatsBackend implementation and the apply, usingClient, and usingDefaultClient entry points, then trace how closeFactory is set and used. Compare the construction paths and existing call sites to clarify the intended lifecycle semantics. Done should provide a documented, consistent way to create a decorated SttpBackend without losing the required factory-closing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100