NuGet package for VisualStudio 2012
Class reference
[Actors]
[Async-Await and Actor rules!]
Changelog: see 'Files' menu.
Forum for suggestions and help: see 'Discussion' menu.
[Implement a client using AsyncWcfLib]
[Implement a service using AsyncWcfLib]
[Implement messages using AsyncWcfLib]
[Run AsyncWcfLib.Test1], [Run AsyncWcfLib.Test2], [Run AsyncWcfLib.Test3]
[Build AsyncWcfLib on Linux]
[Adapt AsyncWcfLib tracing]
[Concept of AsyncWcfLib], [Other concepts]
[Service- and client identification]
[Threadsafety and SynchronizationContext]
[Asynchronous Responses]
[Understand extension methods], [Understand lambda expressions]
[Download library sourcecode]
AsyncWcfLib is a software library for distributed computing based on Microsoft WCF.
AsyncWcfLib is a lightweight message bus bridging Windows and Linux by using the .NET Framework or Mono.
It supports callback based asynchrony as well as the new async-await pattern available in .NET 4.5.
AsyncWcfLib supports threadsafety through an actor based programming model.
Actors are loosly coupled system units interacting by passing messages.
Message objects are passed inside a process between actors running on different threads.
Also, messages may be passed between actors running on different processes, hosts and operating systems.
The library is designed for configuration free, asynchronous messaging.
A router application is included. It discovers actors by their name on any linked host, even
when host name resolution is not possible because of routing- or operating system limitations.
Large computing intense systems tend to be distributed applications interacting through asynchronous message exchange.
Important requirements in such systems are:
AsyncWcfLib focuses on such systems, used e.g. for industrial control and automation.
It is written in C-sharp and currently available for Microsoft VisualStudio 2012, 2010 and Mono.
All content of http://AsyncWcfLib.sourceforge.net is released under a modified MIT open source license.
It lets you use the software in your own, possibly closed source project.
Asynchronous communication
Asynchronious communication makes applications very responsive, even in case of communication failure.
When communicating with several partners, you probably have to go asynchronous in one or another way.
Microsoft introduced async-await, a great step forward to coordinate asynchronous processes.
But programming with different threads (e.g. the default threadpool) is still errorprone and needs special care about locking.
AsyncWcfLib makes interthread and interprocess communication transparent.
The actor model introduces a lock-free solution enabling your application to run on all CPU's at full speed.
The library has a very compact design: SF.AsyncWcfLib.dll is 100 kBytes, SF.AsyncWcfLib.Router.exe is 20 kBytes and Nito.Async.dll is 32 kBytes in size.
A router-application knows all services by name.
No WCF service or client configuration files are needed, no TCP ports must be configured.
Service names must be unique in a plant.
The 'SF.AsyncWcfLib.Router.exe' may run on each host, it can discover all AsyncWcfLib services of a plant.
This router application is only used during connection buildup, it may be restarted without message loss.
Services may be moved from one host to another without changing client configuration.
Backup applications may be started up in case the main application (or its host) is shutting down.
Client and service share assemblies for application specific message definition.
AsyncWcfLib's design is simply sending and receiving message-objects.
All message objects are derived from the base class WcfMessage.
You define your own message classes and build them into an assembly.
This assembly is referenced by your clients and your services.
The assembly is deployed on each host when installing/updating an application, see [AsyncWcfLib package diagram].
Forward/backward compatible, tolerant message versioning.
Have you ever tried to install a new application (maybe for test purposes) in a running network or tree of partner applications ?
Then you will agree that forward/backward compatibility is essential.
Thanks to Microsoft and XML, tolerant versioning 1, and 2 is built into WCF, see also [AsyncWcfLib class diagram messages].
AsyncWcfLib has the required extension-data for full roundtrip compatibility.
Durable services and durable clients.
In a web of communicating applications for industrial control it is important for each service to uniquely identify each client.
It makes it possible to correctly react on the shutdown/restart events of a single client.
AsynWcfLibs services have builtin client identification for three levels of durability, see [Service- and client identification].
Service may send notifications to clients.
In a web of applications it is often unavoidable that one application has several clients
and services at the same time. Often the service should send information to the client, the client did not request for.
The client/server design pattern does not really fit. These applications actually are peers.
But the most reliably underlying communication mechanism (TCP) demands one peer to be client
whereas the other must play service.
AsyncWcfLib allows a service to send more messages than requested without using 'DualHttpBinding'.
Dual binding could be barred by firewalls.
Download AsyncWcfLib.Test1 and read [Run AsyncWcfLib.Test1]
Or download the NuGet package http://nuget.org/packages/AsyncWcfLib AsyncWcfLib in Visual Studio 2012 and look for the unit tests.
Wiki: Actors
Wiki: Adapt AsyncWcfLib tracing
Wiki: Async-Await and Actor rules!
Wiki: AsyncWcfLib class diagram messages
Wiki: AsyncWcfLib package diagram
Wiki: Asynchronous Responses
Wiki: Build AsyncWcfLib on Linux
Wiki: Concept of AsyncWcfLib
Wiki: Download library sourcecode
Wiki: Images
Wiki: Implement a client using AsyncWcfLib
Wiki: Implement a service using AsyncWcfLib
Wiki: Implement messages using AsyncWcfLib
Wiki: Other concepts
Wiki: Run AsyncWcfLib.Test1
Wiki: Run AsyncWcfLib.Test2
Wiki: Run AsyncWcfLib.Test3
Wiki: Service- and client identification
Wiki: Threadsafety and SynchronizationContext
Wiki: Understand extension methods
Wiki: Understand lambda expressions