Redpoint.ProgressMonitor 2025.1218.1281

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.1281
                    
NuGet\Install-Package Redpoint.ProgressMonitor -Version 2025.1218.1281
                    
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.1281" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Redpoint.ProgressMonitor" Version="2025.1218.1281" />
                    
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.1281
                    
#r "nuget: Redpoint.ProgressMonitor, 2025.1218.1281"
                    
#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.1281
                    
#: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.1281
                    
Install as a Cake Addin
#tool nuget:?package=Redpoint.ProgressMonitor&version=2025.1218.1281
                    
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 172 9/10/2025
2025.1251.740 161 9/8/2025
2025.1249.408 108 9/6/2025
2025.1245.159 173 9/2/2025
2025.1241.1004 197 8/29/2025
2025.1241.337 215 8/29/2025
2025.1241.335 213 8/29/2025
2025.1239.82 215 8/27/2025
2025.1236.697 198 8/24/2025
2025.1235.897 103 8/23/2025
2025.1234.740 126 8/22/2025
2025.1234.625 134 8/22/2025
2025.1234.484 138 8/22/2025
2025.1234.426 145 8/22/2025
2025.1234.329 149 8/22/2025
2025.1234.304 152 8/22/2025
2025.1234.279 155 8/22/2025
2025.1234.210 159 8/22/2025
2025.1234.185 146 8/22/2025
2025.1234.108 164 8/22/2025
2025.1234.70 164 8/22/2025
2025.1233.957 171 8/21/2025
2025.1233.933 168 8/21/2025
2025.1233.915 162 8/21/2025
2025.1233.885 154 8/21/2025
2025.1233.764 173 8/21/2025
2025.1233.694 167 8/21/2025
2025.1233.677 169 8/21/2025
2025.1233.212 169 8/21/2025
2025.1233.74 162 8/21/2025
2025.1233.72 164 8/21/2025
2025.1233.28 160 8/21/2025
2025.1232.155 171 8/20/2025
2025.1232.154 165 8/20/2025
2025.1232.104 163 8/20/2025
2025.1232.102 166 8/20/2025
2025.1231.1026 168 8/19/2025
2025.1231.941 172 8/19/2025
2025.1231.499 162 8/19/2025
2025.1231.484 166 8/19/2025
2025.1231.297 164 8/19/2025
2025.1230.859 167 8/18/2025
2025.1228.220 102 8/16/2025
2025.1227.934 129 8/15/2025
2025.1227.904 126 8/15/2025
2025.1227.852 123 8/15/2025
2025.1227.816 129 8/15/2025
2025.1227.77 166 8/15/2025
2025.1226.857 173 8/14/2025
2025.1226.472 177 8/14/2025
2025.1226.163 177 8/14/2025
2025.1222.583 173 8/10/2025
2025.1222.562 174 8/10/2025
2025.1222.437 174 8/10/2025
2025.1222.425 170 8/10/2025
2025.1220.271 237 8/8/2025
2025.1220.225 234 8/8/2025
2025.1220.80 243 8/8/2025
2025.1219.568 248 8/7/2025
2025.1219.546 251 8/7/2025
2025.1219.514 247 8/7/2025
2025.1219.513 243 8/7/2025
2025.1219.511 241 8/7/2025
2025.1219.421 249 8/7/2025
2025.1219.377 245 8/7/2025
2025.1219.362 250 8/7/2025
2025.1219.361 246 8/7/2025
2025.1218.1281 250 8/6/2025
2025.1218.1266 245 8/6/2025
2025.1218.1264 249 8/6/2025
2025.1218.1255 250 8/6/2025
2025.1218.1223 251 8/6/2025
2025.1218.1180 246 8/6/2025
2025.1218.1166 242 8/6/2025
2025.1218.1154 246 8/6/2025
2025.1218.1088 252 8/6/2025
2025.1218.595 246 8/6/2025
2025.1218.554 249 8/6/2025
2025.1218.544 247 8/6/2025
2025.1218.523 246 8/6/2025
2025.1218.499 253 8/6/2025
2025.1218.427 253 8/6/2025
2025.1218.415 247 8/6/2025
2025.1218.187 251 8/6/2025
2025.1218.174 248 8/6/2025
2025.1218.148 251 8/6/2025
2025.1218.123 246 8/6/2025
2025.1217.886 252 8/5/2025
2025.1217.560 250 8/5/2025
2025.1217.516 252 8/5/2025
2025.1217.512 256 8/5/2025
2025.1217.503 257 8/5/2025
2025.1216.1103 214 8/4/2025
2025.1216.1025 210 8/4/2025
2025.1216.978 191 8/4/2025
2025.1216.897 188 8/4/2025
2025.1216.893 187 8/4/2025
2025.1216.884 191 8/4/2025
2025.1216.873 186 8/4/2025
2025.1216.824 189 8/4/2025
2025.1216.767 189 8/4/2025
2025.1216.745 194 8/4/2025
2025.1216.411 168 8/4/2025
2025.1216.396 167 8/4/2025
2025.1216.386 170 8/4/2025
2025.1216.357 165 8/4/2025
2025.1216.347 164 8/4/2025
2025.1216.334 169 8/4/2025
2025.1216.319 161 8/4/2025
2025.1215.930 132 8/3/2025
2025.1215.928 134 8/3/2025
2025.1215.911 138 8/3/2025
2025.1215.892 133 8/3/2025
2025.1215.842 134 8/3/2025
2025.1209.1064 133 7/28/2025
2025.1209.1061 126 7/28/2025
2025.1209.1047 131 7/28/2025
2025.1209.1038 133 7/28/2025
2025.1209.1034 132 7/28/2025
2025.1209.948 137 7/28/2025
2025.1209.881 142 7/28/2025
2025.1209.773 150 7/28/2025
2025.1209.765 140 7/28/2025
2025.1209.758 141 7/28/2025
2025.1209.727 145 7/28/2025
2025.1209.658 145 7/28/2025
2025.1209.300 140 7/28/2025
2025.1209.284 143 7/28/2025
2025.1209.264 140 7/28/2025
2025.1209.227 141 7/28/2025
2025.1209.198 137 7/28/2025
2025.1209.179 148 7/28/2025
2025.1208.826 160 7/27/2025
2025.1208.627 120 7/27/2025
2025.1208.617 120 7/27/2025
2025.1208.570 117 7/27/2025
2025.1208.568 128 7/27/2025
2025.1208.566 116 7/27/2025
2025.1206.491 450 7/25/2025
2025.1206.247 480 7/25/2025
2025.1205.230 499 7/24/2025
2025.1203.826 565 7/22/2025
2025.1202.906 516 7/21/2025
2025.1202.904 508 7/21/2025
2025.1202.283 438 7/21/2025
2025.1201.470 259 7/20/2025
2025.1199.287 157 7/18/2025
2025.1198.1048 169 7/17/2025
2025.1198.682 166 7/17/2025
2025.1198.638 169 7/17/2025
2025.1198.574 170 7/17/2025
2025.1198.187 174 7/17/2025
2025.1191.922 176 7/10/2025
2025.1191.235 179 7/10/2025
2025.1190.175 177 7/9/2025
2025.1189.851 180 7/8/2025
2025.1189.841 178 7/8/2025
2025.1187.587 179 7/6/2025
2025.1183.853 174 7/2/2025
2025.1181.644 170 6/30/2025
2025.1175.340 188 6/24/2025
2025.1174.62 177 6/23/2025
2025.1171.352 175 6/20/2025
2025.1169.413 176 6/18/2025
2025.1166.1191 171 6/15/2025
2025.1166.1178 176 6/15/2025
2025.1166.1177 176 6/15/2025
2025.1159.445 155 6/8/2025
2025.1159.364 152 6/8/2025
2025.1159.324 155 6/8/2025
2025.1155.438 179 6/4/2025
2025.1141.1424 183 5/21/2025
2025.1140.383 183 5/20/2025
2025.1140.377 182 5/20/2025
2025.1139.983 184 5/19/2025
2025.1139.952 180 5/19/2025
2025.1139.941 185 5/19/2025
2025.1139.855 181 5/19/2025
2025.1139.850 178 5/19/2025
2025.1139.837 176 5/19/2025
2025.1139.811 175 5/19/2025
2025.1139.806 181 5/19/2025
2025.1139.796 180 5/19/2025
2025.1139.729 181 5/19/2025
2025.1139.719 181 5/19/2025
2025.1139.706 181 5/19/2025
2025.1139.694 178 5/19/2025
2025.1139.679 182 5/19/2025
2025.1139.662 174 5/19/2025
2025.1139.638 158 5/19/2025
2025.1139.628 159 5/19/2025
2025.1139.626 166 5/19/2025
2025.1139.619 163 5/19/2025
2025.1139.605 161 5/19/2025
2025.1139.600 164 5/19/2025
2025.1139.583 163 5/19/2025
2025.1139.573 162 5/19/2025
2025.1139.564 162 5/19/2025
2025.1139.552 164 5/19/2025
2025.1139.543 157 5/19/2025
2025.1138.909 167 5/18/2025
2025.1136.150 238 5/16/2025
2025.1135.267 237 5/15/2025
2025.1135.143 245 5/15/2025
2025.1133.453 247 5/13/2025
2025.1133.351 250 5/13/2025
2025.1133.349 256 5/13/2025
2025.1133.347 248 5/13/2025
2025.1130.236 98 5/10/2025
2025.1129.831 127 5/9/2025
2025.1129.346 627 5/9/2025
2023.1176.407 230 6/25/2023
2023.1176.396 192 6/25/2023
2023.1176.363 203 6/25/2023
2023.1176.360 239 6/25/2023
2023.1175.638 198 6/24/2023
2023.1170.907 194 6/19/2023
2023.1170.900 196 6/19/2023
2023.1167.562 199 6/16/2023
2023.1167.556 204 6/16/2023
2023.1167.496 216 6/16/2023
2023.1166.1008 219 6/15/2023
2023.1166.938 191 6/15/2023
2023.1166.713 211 6/15/2023
2023.1166.699 200 6/15/2023
2023.1165.1065 209 6/14/2023
2023.1165.888 205 6/14/2023
2023.1165.878 207 6/14/2023
2023.1165.861 196 6/14/2023
2023.1165.828 206 6/14/2023
2023.1165.686 218 6/14/2023
2023.1165.653 200 6/14/2023
2023.377.1003 291 5/31/2023
2023.377.909 223 5/31/2023
2023.377.558 220 5/31/2023
2023.365.1417 268 5/30/2023
2023.365.1350 208 5/30/2023
2023.365.1327 204 5/30/2023
2023.365.1306 225 5/30/2023
2023.365.1198 232 5/30/2023
2023.365.1046 210 5/30/2023
2023.365.710 209 5/30/2023
2023.365.703 221 5/30/2023
2023.365.336 211 5/30/2023
2023.174.636 208 6/14/2023
2023.174.616 191 6/14/2023
2023.174.442 207 6/14/2023
2023.162.1243 200 6/13/2023
2023.162.1225 207 6/13/2023
2023.162.1023 194 6/13/2023
2023.162.948 199 6/13/2023
2023.162.865 204 6/13/2023
2023.162.770 228 6/13/2023
2023.162.734 217 6/13/2023
2023.162.701 210 6/13/2023
2023.162.470 219 6/13/2023
2023.162.418 203 6/13/2023
2023.150.1142 202 6/12/2023
2023.150.1121 206 6/12/2023
2023.150.1095 207 6/12/2023
2023.150.1081 193 6/12/2023
2023.150.1066 202 6/12/2023
2023.150.999 195 6/12/2023
2023.150.916 221 6/12/2023
2023.150.865 205 6/12/2023
2023.150.831 205 6/12/2023
2023.150.774 204 6/12/2023
2023.150.613 203 6/12/2023
2023.150.558 214 6/12/2023
2023.150.456 226 6/12/2023
2023.150.450 228 6/12/2023
2023.150.220 226 6/12/2023
2023.150.179 231 6/12/2023
2023.150.167 232 6/12/2023
2023.138.864 216 6/11/2023
2023.138.837 211 6/11/2023
2023.138.363 221 6/11/2023
2023.138.224 251 6/11/2023
2023.138.213 195 6/11/2023
2023.126.1167 224 6/11/2023
2023.126.1148 219 6/10/2023
2023.126.838 228 6/10/2023
2023.126.794 223 6/10/2023
2023.126.745 223 6/10/2023
2023.126.714 235 6/10/2023
2023.126.662 232 6/10/2023
2023.114.544 208 6/9/2023
2023.114.351 218 6/9/2023
2023.90.1030 222 6/7/2023
2023.90.1009 204 6/7/2023
2023.54.1152 205 6/4/2023
2023.54.419 227 6/4/2023
2023.54.198 207 6/4/2023
2023.54.60 190 6/4/2023
2023.54.48 222 6/4/2023
2023.42.745 208 6/3/2023
2023.30.1191 208 6/2/2023
2023.30.1172 220 6/2/2023
2023.30.1163 214 6/2/2023
2023.30.1147 218 6/2/2023
2023.30.1136 235 6/2/2023
2023.30.765 229 6/2/2023
2023.30.761 216 6/2/2023
2023.30.747 230 6/2/2023
2023.30.734 217 6/2/2023