Server Page

This page is located in the "Server" project of the default Blazor Visual Studio project template. The component below uses the "InteractiveServer" render mode.

Demo

You can use this page to kick the tries of Blazor Web Workers. The dropdown below holds references to JavaScript web worker threads created by pressing the blue button, except for the first one (called "No Worker; Invoke Method Directly") which simulations "conventional" code running on the main UI thread.

This demo runs a simple service that performs a Task.Delay for the amount of time specified under "Simulation Seconds." If "Register Callbacks" is selected, the demo service will fire a callback every second. Note that the events won't fire for the initial direct "worker."

As a more practical example, you can use the "File Upload" section to really see Blazor Web Workers in action. Behind the scenes, the .NET code in a worker thread uses Azure blogs progressive uploads to power real-time progress bars.

Next, click "Simulate Error" to see that we can get real stack traces for debugging purposes from the heavily IL-based proxy code running in a web worker thread.

Finally, "Terminate Selected Worker" will destory the selected web worker thread.

Web Workers

File Upload

Output Console


An unhandled error has occurred. Reload 🗙