Skip to content
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

Merged
merged 11 commits into from
Nov 8, 2024
Merged

refactor/request data v3 #130

merged 11 commits into from
Nov 8, 2024

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Nov 1, 2024

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 (on NodePool) and that instance is used everywhere. Before it could be set seperately on NodePool and TransportConfiguration, 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 on RequestPipeline. It implements IReadOnlyCollection<Audit> and is exposed as such to users.

  • This PR also merges DefaultRequestPipeline and RequestPipeline into one.

- 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.
@Mpdreamz Mpdreamz force-pushed the refactor/request-data-v3 branch from 6aee59f to 95ea6c6 Compare November 1, 2024 16:35
Copy link
Collaborator

@stevejgordon stevejgordon left a 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.

@Mpdreamz
Copy link
Member Author

Mpdreamz commented Nov 8, 2024

Great nits! Upated the PR.

Copy link
Collaborator

@stevejgordon stevejgordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mpdreamz Mpdreamz merged commit 3352233 into main Nov 8, 2024
5 checks passed
@Mpdreamz Mpdreamz deleted the refactor/request-data-v3 branch November 8, 2024 11:58
@flobernd flobernd added the v0.5.0 label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants