Reactive-style transactional device communications for ASCOM drivers with guaranteed sequencing and thread-safety
Reactive ASCOM (namespace TA.Ascom.ReactiveCommunications) is a library based on the Reactive Extensions for .NET for simplifying device communications over serial, Ethernet and other types of communications channel to embedded controllers, while guaranteeing correct sequencing and thread-safety of transactions.
Originally developed for use with ASCOM drivers, but may be useful for any software that needs to communicate with an embedded controller using a predominantly command-response protocol.
This blog article describes the approach and gives a bried overview of how to use the library. The source code contains a sample console application demonstrating how to create and use the various classes.
Available as a NuGet package - simply Install-Package TA.Ascom.ReactiveCommunications
The main project page for Reactive ASCOM is at: http://tigra-astronomy.com/reactive-communications-for-ascom
Reactive ASCOM uses the MIT License.
Tim Long - Tigra Astronomy, May 2015.
- Updated dependent NuGet packages to latest release versions before rebuilding and pushing to NuGet.
-
added the
ChannelFactory
class and the ability to register custom user-supplied channel implementations. RemovedDeviceEndpoint.FromConnectionString()
. This is a breaking change and applications will now need to use the newChannelFactory
class to create a communications channel from a connection string, instead ofDeviceEndpoint.FromConnectionString()
Builtin channel types are pre-registered in the
ChannelFactory
. Custom channel implementations can be added by callingRegisterChannelType()
. You must supply aPredicate<string>
that tests whether a connection string is valid for the channel type; aFunc<string,DeviceEndpoint>
for creating an endpoint from a connection string; and aFunc<DeviceEndpoint, ICommunicationsChannel>
for creating the channel itself.If the builtin channel types are not required, they can be deleted by calling
ClearRegisteredDevices()
prior to adding any custom implementations.