-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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
- Abstract base class for flag fetching
- Default implementation using requests
- Documentation for custom implementations
- Unit tests for custom fetcher support
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request