softwaremill / softwaremill/sttp

Confusing ArmeriaCatsBackend initialization

Open
#2,628 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.