Redpoint.ProgressMonitor 2025.1218.1154

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Redpoint.ProgressMonitor --version 2025.1218.1154
                    
NuGet\Install-Package Redpoint.ProgressMonitor -Version 2025.1218.1154
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Redpoint.ProgressMonitor" Version="2025.1218.1154" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Redpoint.ProgressMonitor" Version="2025.1218.1154" />
                    
Directory.Packages.props
<PackageReference Include="Redpoint.ProgressMonitor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Redpoint.ProgressMonitor --version 2025.1218.1154
                    
#r "nuget: Redpoint.ProgressMonitor, 2025.1218.1154"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Redpoint.ProgressMonitor@2025.1218.1154
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Redpoint.ProgressMonitor&version=2025.1218.1154
                    
Install as a Cake Addin
#tool nuget:?package=Redpoint.ProgressMonitor&version=2025.1218.1154
                    
Install as a Cake Tool

Redpoint.ProgressMonitor

This library provides APIs for monitoring and reporting the progress of arbitrary operations in console applications.

Read on for the following examples:

Example for a generic stream

You can monitor an operation that uses a stream like so:

// Inject these services.
IProgressFactory _progressFactory;
IMonitorFactory _monitorFactory;

using (var stream = new FileStream(...))
{
    // Start monitoring.
    var cts = new CancellationTokenSource();
    var progress = _progressFactory.CreateProgressForStream(stream);
    var monitorTask = Task.Run(async () =>
    {
        var monitor = _monitorFactory.CreateByteBasedMonitor();
        await monitor.MonitorAsync(
            progress,
            SystemConsole.ConsoleInformation,
            SystemConsole.WriteProgressToConsole,
            cts.Token);
    });

    // e.g. hash the stream.
    byte[] hashBytes;
    using (var hasher = SHA256.Create())
    {
        hashBytes = await hasher.ComputeHashAsync(stream);
    }

    // Stop monitoring.
    await SystemConsole.CancelAndWaitForConsoleMonitoringTaskAsync(monitorTask, cts);
}

Example for a HTTP download

If you're reporting progress on a HTTP stream, there's a few extra things to keep in mind:

  • You need to pass HttpCompletionOption.ResponseHeadersRead as the completion option, or HttpClient will buffer the entire response by default.
  • You need to wrap the stream you read from in PositionAwareStream, which is a class provided by this library. Since the underlying HTTP stream does not support Position or Length, this wrapping stream tracks the position as the stream is read from and allows the length to be passed in as a constructor parameter (which you should set based on the Content-Length header).

Below is a concise example of how to show the progress of downloading a file:

using (var client = new HttpClient())
{
    using (var target = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None))
    {
        var response = await client.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead);
        using (var stream = new PositionAwareStream(
            await response.Content.ReadAsStreamAsync(),
            response.Content.Headers.ContentLength!.Value))
        {
            var cts = new CancellationTokenSource();
            var progress = _progressFactory.CreateProgressForStream(stream);
            var monitorTask = Task.Run(async () =>
            {
                var monitor = _monitorFactory.CreateByteBasedMonitor();
                await monitor.MonitorAsync(
                    progress,
                    SystemConsole.ConsoleInformation,
                    SystemConsole.WriteProgressToConsole,
                    cts.Token);
            });

            await stream.CopyToAsync(target);
            
            await SystemConsole.CancelAndWaitForConsoleMonitoringTaskAsync(monitorTask, cts);
        }
    }
}

The SystemConsole static class

The SystemConsole type provides common values for monitoring parameters, such as the current console information and rendering progress information to the console. You should replace the static values in the examples above with your own callbacks and values if you're not rendering progress to the console.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Redpoint.ProgressMonitor:

Package Downloads
Redpoint.PackageManagement

Provides APIs for installing, upgrading and uninstalling packages with WinGet and Homebrew.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.1253.415 131 9/10/2025
2025.1251.740 131 9/8/2025
2025.1249.408 70 9/6/2025
2025.1245.159 138 9/2/2025
2025.1241.1004 164 8/29/2025
2025.1241.337 178 8/29/2025
2025.1241.335 173 8/29/2025
2025.1239.82 182 8/27/2025
2025.1236.697 163 8/24/2025
2025.1235.897 67 8/23/2025
2025.1234.740 89 8/22/2025
2025.1234.625 97 8/22/2025
2025.1234.484 101 8/22/2025
2025.1234.426 108 8/22/2025
2025.1234.329 112 8/22/2025
2025.1234.304 115 8/22/2025
2025.1234.279 118 8/22/2025
2025.1234.210 122 8/22/2025
2025.1234.185 122 8/22/2025
2025.1234.108 130 8/22/2025
2025.1234.70 125 8/22/2025
2025.1233.957 130 8/21/2025
2025.1233.933 131 8/21/2025
2025.1233.915 125 8/21/2025
2025.1233.885 127 8/21/2025
2025.1233.764 134 8/21/2025
2025.1233.694 130 8/21/2025
2025.1233.677 133 8/21/2025
2025.1233.212 134 8/21/2025
2025.1233.74 126 8/21/2025
2025.1233.72 128 8/21/2025
2025.1233.28 129 8/21/2025
2025.1232.155 132 8/20/2025
2025.1232.154 128 8/20/2025
2025.1232.104 129 8/20/2025
2025.1232.102 130 8/20/2025
2025.1231.1026 130 8/19/2025
2025.1231.941 136 8/19/2025
2025.1231.499 128 8/19/2025
2025.1231.484 129 8/19/2025
2025.1231.297 130 8/19/2025
2025.1230.859 133 8/18/2025
2025.1228.220 65 8/16/2025
2025.1227.934 92 8/15/2025
2025.1227.904 89 8/15/2025
2025.1227.852 89 8/15/2025
2025.1227.816 92 8/15/2025
2025.1227.77 133 8/15/2025
2025.1226.857 136 8/14/2025
2025.1226.472 140 8/14/2025
2025.1226.163 139 8/14/2025
2025.1222.583 139 8/10/2025
2025.1222.562 135 8/10/2025
2025.1222.437 137 8/10/2025
2025.1222.425 133 8/10/2025
2025.1220.271 198 8/8/2025
2025.1220.225 198 8/8/2025
2025.1220.80 207 8/8/2025
2025.1219.568 211 8/7/2025
2025.1219.546 213 8/7/2025
2025.1219.514 211 8/7/2025
2025.1219.513 208 8/7/2025
2025.1219.511 207 8/7/2025
2025.1219.421 211 8/7/2025
2025.1219.377 211 8/7/2025
2025.1219.362 213 8/7/2025
2025.1219.361 209 8/7/2025
2025.1218.1281 213 8/6/2025
2025.1218.1266 211 8/6/2025
2025.1218.1264 212 8/6/2025
2025.1218.1255 213 8/6/2025
2025.1218.1223 213 8/6/2025
2025.1218.1180 212 8/6/2025
2025.1218.1166 206 8/6/2025
2025.1218.1154 209 8/6/2025
2025.1218.1088 214 8/6/2025
2025.1218.595 212 8/6/2025
2025.1218.554 211 8/6/2025
2025.1218.544 212 8/6/2025
2025.1218.523 208 8/6/2025
2025.1218.499 214 8/6/2025
2025.1218.427 217 8/6/2025
2025.1218.415 212 8/6/2025
2025.1218.187 225 8/6/2025
2025.1218.174 221 8/6/2025
2025.1218.148 221 8/6/2025
2025.1218.123 219 8/6/2025
2025.1217.886 225 8/5/2025
2025.1217.560 224 8/5/2025
2025.1217.516 226 8/5/2025
2025.1217.512 226 8/5/2025
2025.1217.503 228 8/5/2025
2025.1216.1103 190 8/4/2025
2025.1216.1025 188 8/4/2025
2025.1216.978 170 8/4/2025
2025.1216.897 167 8/4/2025
2025.1216.893 168 8/4/2025
2025.1216.884 170 8/4/2025
2025.1216.873 166 8/4/2025
2025.1216.824 168 8/4/2025
2025.1216.767 168 8/4/2025
2025.1216.745 173 8/4/2025
2025.1216.411 147 8/4/2025
2025.1216.396 145 8/4/2025
2025.1216.386 145 8/4/2025
2025.1216.357 144 8/4/2025
2025.1216.347 143 8/4/2025
2025.1216.334 145 8/4/2025
2025.1216.319 140 8/4/2025
2025.1215.930 111 8/3/2025
2025.1215.928 114 8/3/2025
2025.1215.911 114 8/3/2025
2025.1215.892 112 8/3/2025
2025.1215.842 113 8/3/2025
2025.1209.1064 102 7/28/2025
2025.1209.1061 96 7/28/2025
2025.1209.1047 95 7/28/2025
2025.1209.1038 98 7/28/2025
2025.1209.1034 96 7/28/2025
2025.1209.948 96 7/28/2025
2025.1209.881 99 7/28/2025
2025.1209.773 105 7/28/2025
2025.1209.765 95 7/28/2025
2025.1209.758 100 7/28/2025
2025.1209.727 101 7/28/2025
2025.1209.658 96 7/28/2025
2025.1209.300 96 7/28/2025
2025.1209.284 98 7/28/2025
2025.1209.264 97 7/28/2025
2025.1209.227 96 7/28/2025
2025.1209.198 97 7/28/2025
2025.1209.179 99 7/28/2025
2025.1208.826 107 7/27/2025
2025.1208.627 71 7/27/2025
2025.1208.617 67 7/27/2025
2025.1208.570 67 7/27/2025
2025.1208.568 67 7/27/2025
2025.1208.566 68 7/27/2025
2025.1206.491 398 7/25/2025
2025.1206.247 427 7/25/2025
2025.1205.230 467 7/24/2025
2025.1203.826 536 7/22/2025
2025.1202.906 493 7/21/2025
2025.1202.904 488 7/21/2025
2025.1202.283 414 7/21/2025
2025.1201.470 237 7/20/2025
2025.1199.287 132 7/18/2025
2025.1198.1048 145 7/17/2025
2025.1198.682 143 7/17/2025
2025.1198.638 145 7/17/2025
2025.1198.574 147 7/17/2025
2025.1198.187 150 7/17/2025
2025.1191.922 153 7/10/2025
2025.1191.235 156 7/10/2025
2025.1190.175 154 7/9/2025
2025.1189.851 157 7/8/2025
2025.1189.841 158 7/8/2025
2025.1187.587 156 7/6/2025
2025.1183.853 151 7/2/2025
2025.1181.644 146 6/30/2025
2025.1175.340 162 6/24/2025
2025.1174.62 152 6/23/2025
2025.1171.352 146 6/20/2025
2025.1169.413 153 6/18/2025
2025.1166.1191 150 6/15/2025
2025.1166.1178 153 6/15/2025
2025.1166.1177 153 6/15/2025
2025.1159.445 134 6/8/2025
2025.1159.364 129 6/8/2025
2025.1159.324 132 6/8/2025
2025.1155.438 154 6/4/2025
2025.1141.1424 159 5/21/2025
2025.1140.383 160 5/20/2025
2025.1140.377 159 5/20/2025
2025.1139.983 162 5/19/2025
2025.1139.952 157 5/19/2025
2025.1139.941 161 5/19/2025
2025.1139.855 161 5/19/2025
2025.1139.850 155 5/19/2025
2025.1139.837 153 5/19/2025
2025.1139.811 155 5/19/2025
2025.1139.806 157 5/19/2025
2025.1139.796 159 5/19/2025
2025.1139.729 158 5/19/2025
2025.1139.719 158 5/19/2025
2025.1139.706 158 5/19/2025
2025.1139.694 155 5/19/2025
2025.1139.679 159 5/19/2025
2025.1139.662 156 5/19/2025
2025.1139.638 151 5/19/2025
2025.1139.628 152 5/19/2025
2025.1139.626 159 5/19/2025
2025.1139.619 156 5/19/2025
2025.1139.605 154 5/19/2025
2025.1139.600 155 5/19/2025
2025.1139.583 156 5/19/2025
2025.1139.573 158 5/19/2025
2025.1139.564 155 5/19/2025
2025.1139.552 157 5/19/2025
2025.1139.543 153 5/19/2025
2025.1138.909 158 5/18/2025
2025.1136.150 228 5/16/2025
2025.1135.267 230 5/15/2025
2025.1135.143 238 5/15/2025
2025.1133.453 240 5/13/2025
2025.1133.351 244 5/13/2025
2025.1133.349 249 5/13/2025
2025.1133.347 241 5/13/2025
2025.1130.236 91 5/10/2025
2025.1129.831 120 5/9/2025
2025.1129.346 161 5/9/2025
2023.1176.407 228 6/25/2023
2023.1176.396 190 6/25/2023
2023.1176.363 201 6/25/2023
2023.1176.360 237 6/25/2023
2023.1175.638 196 6/24/2023
2023.1170.907 191 6/19/2023
2023.1170.900 193 6/19/2023
2023.1167.562 196 6/16/2023
2023.1167.556 200 6/16/2023
2023.1167.496 213 6/16/2023
2023.1166.1008 216 6/15/2023
2023.1166.938 188 6/15/2023
2023.1166.713 208 6/15/2023
2023.1166.699 197 6/15/2023
2023.1165.1065 206 6/14/2023
2023.1165.888 202 6/14/2023
2023.1165.878 204 6/14/2023
2023.1165.861 193 6/14/2023
2023.1165.828 203 6/14/2023
2023.1165.686 215 6/14/2023
2023.1165.653 197 6/14/2023
2023.377.1003 288 5/31/2023
2023.377.909 220 5/31/2023
2023.377.558 217 5/31/2023
2023.365.1417 265 5/30/2023
2023.365.1350 205 5/30/2023
2023.365.1327 201 5/30/2023
2023.365.1306 220 5/30/2023
2023.365.1198 229 5/30/2023
2023.365.1046 207 5/30/2023
2023.365.710 206 5/30/2023
2023.365.703 218 5/30/2023
2023.365.336 208 5/30/2023
2023.174.636 205 6/14/2023
2023.174.616 188 6/14/2023
2023.174.442 204 6/14/2023
2023.162.1243 197 6/13/2023
2023.162.1225 204 6/13/2023
2023.162.1023 191 6/13/2023
2023.162.948 196 6/13/2023
2023.162.865 201 6/13/2023
2023.162.770 225 6/13/2023
2023.162.734 214 6/13/2023
2023.162.701 206 6/13/2023
2023.162.470 216 6/13/2023
2023.162.418 200 6/13/2023
2023.150.1142 199 6/12/2023
2023.150.1121 202 6/12/2023
2023.150.1095 204 6/12/2023
2023.150.1081 190 6/12/2023
2023.150.1066 199 6/12/2023
2023.150.999 192 6/12/2023
2023.150.916 218 6/12/2023
2023.150.865 202 6/12/2023
2023.150.831 202 6/12/2023
2023.150.774 200 6/12/2023
2023.150.613 199 6/12/2023
2023.150.558 211 6/12/2023
2023.150.456 223 6/12/2023
2023.150.450 225 6/12/2023
2023.150.220 223 6/12/2023
2023.150.179 228 6/12/2023
2023.150.167 229 6/12/2023
2023.138.864 213 6/11/2023
2023.138.837 208 6/11/2023
2023.138.363 218 6/11/2023
2023.138.224 248 6/11/2023
2023.138.213 192 6/11/2023
2023.126.1167 220 6/11/2023
2023.126.1148 216 6/10/2023
2023.126.838 225 6/10/2023
2023.126.794 220 6/10/2023
2023.126.745 220 6/10/2023
2023.126.714 231 6/10/2023
2023.126.662 229 6/10/2023
2023.114.544 204 6/9/2023
2023.114.351 215 6/9/2023
2023.90.1030 219 6/7/2023
2023.90.1009 201 6/7/2023
2023.54.1152 202 6/4/2023
2023.54.419 224 6/4/2023
2023.54.198 204 6/4/2023
2023.54.60 187 6/4/2023
2023.54.48 219 6/4/2023
2023.42.745 205 6/3/2023
2023.30.1191 204 6/2/2023
2023.30.1172 217 6/2/2023
2023.30.1163 211 6/2/2023
2023.30.1147 214 6/2/2023
2023.30.1136 232 6/2/2023
2023.30.765 225 6/2/2023
2023.30.761 213 6/2/2023
2023.30.747 227 6/2/2023
2023.30.734 213 6/2/2023