ASP.NET MVC and HTML5 Web Workers

Although the technology has been around for a while now, HTML5 Web Workers didn’t draw my attention until a few days ago. As I’m building a client facing SaaS application for my client, performance is crucial. Having worked with asynchronous methods in C# for years, I thought of using this concept in JavaScript. As it turns out, multithreading in Javascript isn’t really part of the package. You had to work with timeouts and callbacks to implement some kind of asynchronous architecture, but splitting some heavy work into multiple threads (and even background work for that matter) wasn’t really supported out of the box – until HTML5 Web Workers were introduced. In this article, I’ll explore the capabilities in two different ways in the context of a ASP.NET MVC 5 application. What I’m not going to cover is the theoretical aspects of web workers.

ExtJS grid page size – letting the user decide

In addition to this article, I have embedded this feature into a new PagingToolbar child class. Basically it adds a combo box to the toolbar’s items and then adds extra behavior so the store reloads with the specified page size.

 

It can be made even more generic and probably cleaner but this is an acceptable solution to the problem. Comments or suggestions are always welcome!