Skip to content
.NET inter process broadcast message bus with supporting classes
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
samples/ConsoleApp
src
test/TinyIpc.Tests Rename MessagesSent to MessagesPublished Apr 5, 2019
.build.ps1 Replace build script with InvokeBuild script Apr 5, 2019
.editorconfig Update .editorconfig, fix indentation in build props Sep 30, 2018
.gitignore Add package script, remove hardcoded version Aug 3, 2018
LICENSE Initial commit Jan 29, 2014
README.md Update README.md Apr 5, 2019
TinyIpc.sln Update solution file so it matches file structure Mar 27, 2019

README.md

TinyIpc

NuGet

.NET inter process broadcast message bus.

Intended for quick broadcast messaging in desktop applications, it just works.

Quick introduction

  • Designed to be serverless
  • Clients may drop in and out at any time
  • Messages expire after a specified timeout, default 500 milliseconds
  • The log is kept small for performance, default max log size is 1 MB
  • Reads are queued and should be received in the same order as they were published

Benefits and drawbacks

It's easy to use and there is no complicated setup. It is suited for small messages, so big messages probably need some other transport mechanism. With high enough troughput messages may be lost if receivers are not able to get a read lock before the message timeout is reached.

Performance

Every publish operation reads and writes the entire contents of a shared memory mapped file and every read operation which is triggered by writes also reads the entire file so if performance is important then batch publish several messages at once to reduce the amount of reads and writes.

Compared to other solutions

TinyIPC XDMessaging NVents IpcChannel Named Pipes
Broadcasting to all listeners ✓ (1)
No master process
Insensitive to process privilege level
Entirely in memory

1 Via SSDP network discovery

Simple example

One message bus listening to the other.

using (var messagebus1 = new TinyMessageBus("ExampleChannel"))
using (var messagebus2 = new TinyMessageBus("ExampleChannel"))
{
	messagebus2.MessageReceived +=
		(sender, e) => Console.WriteLine(Encoding.UTF8.GetString(e.Message));

	while (true)
	{
		var message = Console.ReadLine();
		await messagebus1.PublishAsync(Encoding.UTF8.GetBytes(message));
	}
}
You can’t perform that action at this time.