Description
Currently, the library is tightly coupled to requests.get for fetching flags. We should allow users to provide their own HTTP client implementation for more flexibility.
Goals
- Allow injection of custom HTTP client
- Support different HTTP libraries (aiohttp, httpx, etc.)
- Maintain backward compatibility
Proposed Implementation
- Create an abstract base class for flag fetching
- Implement the default requests-based fetcher
- Allow custom fetcher injection in Flaggle constructor
- Add documentation and examples
Example Interface
class FlagFetcher(ABC):
@abstractmethod
async def fetch_flags(self, url: str) -> dict:
pass
flaggle = Flaggle(url="https://api.example.com/flags", fetcher=CustomFetcher())
Acceptance Criteria
Description
Currently, the library is tightly coupled to
requests.getfor fetching flags. We should allow users to provide their own HTTP client implementation for more flexibility.Goals
Proposed Implementation
Example Interface
Acceptance Criteria