-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
InngestClient owns a raw HttpClient, isn't IDisposable, and doesn't use IHttpClientFactory. This pattern has several issues:
- Socket exhaustion - Creating multiple clients risks exhausting sockets
- Configuration - Makes global configuration (timeouts, handlers, logging) harder
- Testing - Harder to mock HTTP calls in tests
- Best practices - Doesn't follow .NET HttpClient best practices
Location: Inngest/InngestClient.cs constructors
Suggested Solution
- Use
IHttpClientFactoryfor HttpClient management - Register a named/typed client in DI:
services.AddHttpClient<InngestClient>() - Implement
IDisposableif the client owns any unmanaged resources - Allow configuration via
IHttpClientBuilderfor policies, handlers, etc.
Benefits
- Proper connection pooling and lifecycle management
- Easier to add Polly policies for retries/circuit breakers
- Better testability with
MockHttpMessageHandler - Follows .NET best practices
Priority
Medium - important for production reliability.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request