-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove ipc code #797
Remove ipc code #797
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 63.01% 61.89% -1.12%
==========================================
Files 586 578 -8
Lines 18125 17427 -698
Branches 1277 1214 -63
==========================================
- Hits 11422 10787 -635
+ Misses 6361 6319 -42
+ Partials 342 321 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
|
namespace NexusMods.Abstractions.DateTime; | ||
|
||
/// <summary> | ||
/// A provider for the current time, useful for overriding in tests. | ||
/// </summary> | ||
public interface IDateTimeProvider | ||
{ | ||
/// <summary> | ||
/// Gets the current time in UTC. | ||
/// </summary> | ||
/// <returns></returns> | ||
System.DateTime GetCurrentTimeUtc(); | ||
} |
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.
What's the benefit of using this over the new TimeProvider
API added in .NET 8?
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.
Also, this appears to not be used anywhere, but it probably should be.
This PR conflicts with |
src/Networking/NexusMods.Networking.Downloaders/Tasks/HttpDownloadTask.cs
Outdated
Show resolved
Hide resolved
src/Networking/NexusMods.Networking.Downloaders/Tasks/NxmDownloadTask.cs
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// A typed report for an activity, these are immutable and emitted by the <see cref="IActivityMonitor"/>. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public class ActivityReport<T> : ActivityReport | ||
where T : IDivisionOperators<T, double, T> | ||
{ | ||
/// <summary> | ||
/// The maximum value for the activity, if any. | ||
/// </summary> | ||
public T? Max { get; init; } | ||
|
||
/// <summary> | ||
/// The current value for the activity, if any. | ||
/// </summary> | ||
public T? Current { get; init; } | ||
|
||
/// <summary> | ||
/// If the activity has any progress this will return the amount of progress per second | ||
/// </summary> | ||
public T? Throughput => Current != null && Elapsed.TotalSeconds > 0 ? | ||
Current / Elapsed.TotalSeconds : default; | ||
} |
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.
We can restrict T
to be a value type T : struct
and use Optional<T>
from DynamicData instead of T?
.
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.
All good besides the T?
for value types in the activity types. We should use Optional<T>
instead, as it's much easier to use.
# Conflicts: # src/NexusMods.App/Services.cs # src/NexusMods.DataModel/ArchiveInstaller.cs
This PR doesn't conflict with |
This PR conflicts with |
# Conflicts: # src/NexusMods.App/Program.cs
This PR doesn't conflict with |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 62.14% 61.12% -1.02%
==========================================
Files 594 586 -8
Lines 18656 17965 -691
Branches 1334 1273 -61
==========================================
- Hits 11593 10981 -612
+ Misses 6710 6660 -50
+ Partials 353 324 -29
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR makes the following changes:
NexusMods.Abstractions
to participate in activitesIActivityFactory
and the read sideIActivityMonitor
are separated via interfaces, only import what you need.SetProgress
to update the progressSize
or other such unitsIActivityMontior
exposes aIObservable<ActivityReport>
that can be used to get updates on the activityResolves #792