-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor/request data v3 #130
Conversation
- RequestData is now used as a bound instance over `ITransportConfiguration` and `IRequestConfiguration` record versions of `TransportConfiguration` and `RequestConfiguration` now exists You can create a new instance of `TransportConfiguration` based off another (with test that all properties get assigned) Ensure only `RequestData` deals is in charge of dealing with global and local configuration. The meant some updates to our request pipelines. We now use a single `RequestData` instance if no per request overrides are provided
Refactor to decouple date provider and introduce Auditor usage. Renamed and altered functions within pipeline components to utilize the `Auditor` class, improving flexibility and modularity. Removed the embedded `DateTimeProvider` instance from several classes and ensured that such dependencies are injected or fetched through associated components like the node pools. This change enhances monitoring and logging capabilities during request processing. Adjust time tolerance in TransportConfigurationTests Increased the time tolerance for the 'LastUpdate' field comparison from 100 milliseconds to 2 seconds. This change enhances the reliability of the test by accommodating larger variations in timing. (cherry picked from commit 14207cb) Simplify RequestPipeline and reuse a singleton instance if we can Add DateTimeProvider and RequestPipelineFactory properties This commit introduces `DateTimeProvider` and `RequestPipelineFactory` properties to the transport configuration. The changes ensure that these properties are properly initialized and accessed throughout various components, enhancing configurability and testability of date and request pipeline behaviors.
6aee59f
to
95ea6c6
Compare
Information is read at a later time from RequestData which is now likely a static instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things and some nits, otherwise it looks good! Good call on moving the response builders to RequestData
. Originally I was hesitant to bung more on that type, but it simplifies some of the other constructors.
src/Elastic.Transport/Configuration/TransportConfigurationDescriptor.cs
Outdated
Show resolved
Hide resolved
Great nits! Upated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR continues #128 and ensures
RequestPipeline
can be shared over many requests unless a local configuration is provided.Similar to
RequestData
being shared in #128.This includes further refactorings:
DateTimeProvider
is only provided externally once (onNodePool
) and that instance is used everywhere. Before it could be set seperately onNodePool
andTransportConfiguration
, not by design but by necessity.RequestPipeline
is no longer disposable (we didn't actually disposed anything).A new type exists
Auditor
this is now explicitly passed to the methods that need it onRequestPipeline
. It implementsIReadOnlyCollection<Audit>
and is exposed as such to users.This PR also merges
DefaultRequestPipeline
andRequestPipeline
into one.