busynessKit 1.0.0

Busyness Kit provides a thread-safe class responsible for knowing if any of its clients are currently busy doing something.

Install-Package busynessKit -Version 1.0.0
dotnet add package busynessKit --version 1.0.0
<PackageReference Include="busynessKit" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add busynessKit --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Busyness Kit

Busyness Kit is intended to solve the curtain problem when dealing with loading indicators in an interface.

Busyness Kit provides a thread-safe class responsible for knowing if any of its clients are currently busy doing something.

Suppose we have more than one async method where some sort of long running operation occurs, of the following sort:

async Task DoStuff() {
	derp = await Stuff();
}

We want to bind the busy indicators in our view graph to some particular thing which is always correct. We'll make a busy token source, like so:

readonly BusyTokenSource busyTokenSource = new BusyTokenSource();

Then we'll modify our methods like so:

async Task DoStuff() {
	using(busyTokenSource.GetToken()) {
		derp = await Stuff();
	}
}

We can then bind the busy indicators in our user interface to the busy token source.

If we're where we're binding the UI by polling, we can pull the current state at any time like so:

busyIndicator.IsVisible = busyTokenSource.IsAnythingBusy;

We can also subscribe to events like so:

busyTokenSource.StateChanged += (source, busynessEventArgs) { … }

Busyness Kit

Busyness Kit is intended to solve the curtain problem when dealing with loading indicators in an interface.

Busyness Kit provides a thread-safe class responsible for knowing if any of its clients are currently busy doing something.

Suppose we have more than one async method where some sort of long running operation occurs, of the following sort:

async Task DoStuff() {
	derp = await Stuff();
}

We want to bind the busy indicators in our view graph to some particular thing which is always correct. We'll make a busy token source, like so:

readonly BusyTokenSource busyTokenSource = new BusyTokenSource();

Then we'll modify our methods like so:

async Task DoStuff() {
	using(busyTokenSource.GetToken()) {
		derp = await Stuff();
	}
}

We can then bind the busy indicators in our user interface to the busy token source.

If we're where we're binding the UI by polling, we can pull the current state at any time like so:

busyIndicator.IsVisible = busyTokenSource.IsAnythingBusy;

We can also subscribe to events like so:

busyTokenSource.StateChanged += (source, busynessEventArgs) { … }

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 423 3/14/2018