Home

Awesome

banner

echo

Actor system that works alongside the functional framework Language-Ext

An issue with working with C# is that no matter how much of Language-Ext functional framework you take on-board, you will always end up bumping into mutable state or side-effecting systems. A way around that is to package up the side-effects into atoms of functional computation that are attached to the mutable state (in whatever form it may take). The Actor model + functional message handling expressions are the perfect programming model for that.

Concurrent programming in C# isn't a huge amount of fun. Yes the TPL gets you lots of stuff for free, but it doesn't magically protect you from race conditions or accessing shared state, and definitely doesn't help with accessing shared external state like a database.

Documentation

DocumentionDescription
OverviewA quick guide to the core features of the Process system
tellSend a message to a Process - This should be your prefered mechanism for communicating with processes
askRequest/response for processes - use this sparingly.
Publish / SubscribeMechanism for a Process to publish messages and state. Other processes can subscribe through their inbox or external systems can subscribe through Reactive streams (Observables).
Message dispatchThe power of any actor system, especially when it comes to a changing network topology is in its message routing and dispatching
ProcessIdProcess address/location mechansim
RoutersA router is a Process that manage sets of 'worker' processes by routing the received messages, following pre-defined behaviours, e.g. Round-robin, broadcast, etc.
DispatchersSimilar to routers but without the need for a router process, all routing is done by the sender
Registered processesA sort of DNS for Processes, can also register dispatchers
RolesA special type of dispatcher that's aware of the aliveness of cluster nodes and what their roles are

Getting started

Make sure you have the Echo.Process DLL included in your project. If you're using F# then you will also need to include Echo.Process.FSharp.

In C# you should be using static Echo.Process, if you're not using C# 6, just prefix all functions in the examples below with Process.

If you want to use it with Redis, include Echo.Process.Redis.dll. To connect to Redis use:

    // C#
    RedisCluster.register();
    ProcessConfig.initialise("sys", "web-front-end", "web-front-end-1", "localhost", "0");

Note, neither of those lines are needed if you're doing in-app messaging only.

Nuget

Nu-get packageDescription
LanguageExt.CoreAll of the core types and functional 'prelude'. This is the core framework that the Echo library is based upon.
Echo.Process'Erlang like' actor system for in-app messaging and massive concurrency
Echo.Process.RedisCluster support for the Echo.Process system for cluster aware processes using Redis for queue and state persistence
Echo.Process.OwinWebSockets gateway into the Echo.Process system. Uses Owin to register the WebSockets handler.
Echo.ProcessJSJavascript API to the Echo.Process system. Supports running of Processes in a client browser, with hooks for two-way UI binding