We’ve just released a new version of the .NET Server Library, supporting .NET Core and the asynchronous programming features of .NET 4.5.
We’ve just released a new version of the .NET Server Library, supporting .NET Core and the asynchronous programming features of .NET 4.5.
This library release introduces potentially breaking changes so we’ve incremented the version number to v4.1.0.
We’ve changed the previous callback syntax used for asynchronous programming to use the more modern async / await approach from .NET 4.5+.
This means that you can now use the Pusher .NET library asynchronously using the following code style:
1using PusherServer; 2 3var pusher = new Pusher(APP_ID, APP_KEY, APP_SECRET); 4 5Task<ITriggerResult> resultTask = pusher.TriggerAsync( "my-channel", "my-event", new { message = "hello world" } ); 6 7// You can do work here that doesn't rely on the result of TriggerAsync 8DoIndependentWork(); 9 10ITriggerResult result = await resultTask;
For more examples see the Readme or the docs.
This also means that the v4.1.0 library is only officially compatible with .NET 4.5 and above (including .NET Core). If you need to support older versions of the .NET framework then you have two options:
Please note that neither of these workarounds will be officially supported by Pusher.
The library now supports .NET Core which means it can be built for any platform with a .NET Core implementation.
We still support standard .NET builds as well, so there are now three separate solutions in this repository:
pusher-dotnet-server
for the standard .NET librarypusher-dotnetcore-server
for the .NET Core compatible librarypusher-dotnet-everything-server
to build both librariesThe NuGet package contains both the .NET Core and .NET 4.5 compatible libraries.
Thanks to John McLoughlin for his work on this release.