<commit_before>MemBroker
=========

MemBroker is a lightweight in memory message broker for .NET. It can be used to reduce coupling and to communicate with different components in your system. Full credit must be given to the MVVM light team from whom I took the base concept of their Messenger class. MemBroker is a refactored, cleaner and extended version.

Features
=========

* Register for messages via base types, interfaces or concrete types
* Register for messages with a filter func
* Deliver sub types to base type registrations
* Unregister entire receivers or specific registrations
* WeakReferences are used to allow recipients to be garbage collected

Example
=========

	var messageBroker = new MessageBroker();

	// Subscribe to messages
	messageBroker.Register(this, new Action<TestMessage>(message =>
	{
		// Handle message
	}));

	// Send message
	messageBroker.Send(new TestMessage());

Interface
=========

	/// <summary>
	/// Register to a given message type
	/// </summary>
	/// <typeparam name="TMessage">The type of the message to register to</typeparam>
	/// <param name="recipient">The object to which the message will be delivered. This reference keeps the registration alive</param>
	/// <param name="action">The callback to invoke upon receiving a message</param>
	void Register<TMessage>(object recipient, Action<TMessage> action);

	/// <summary>
	/// Register to a given message type with an additional filter
	/// </summary>
	/// <typeparam name="TMessage">The type of the message to register to</typeparam>
	/// <param name="recipient">The object to which the message will be delivered. This reference keeps the registration alive</param><commit_msg>Improve documentation<commit_after>MemBroker
=========

MemBroker is a lightweight in memory message broker for .NET. It can be used to reduce coupling and to communicate with different components in your system. Full credit must be given to the MVVM light team from whom I took the base concept of their Messenger class. MemBroker is a refactored, cleaner and extended version.

Features
=========

* Register for messages via base types, interfaces or concrete types
* Register for messages with a filter func
* Deliver sub types to base type registrations
* Unregister entire receivers or specific registrations
* WeakReferences are used to allow recipients to be garbage collected

Example
=========

	var messageBroker = new MessageBroker();

	// Subscribe to messages
	messageBroker.Register<TestMessage>(this, message =>
	{
	// Handle message
	});
	
	// Send message
	messageBroker.Send(new TestMessage());

Interface
=========

	/// <summary>
	/// Register to a given message type
	/// </summary>
	/// <typeparam name="TMessage">The type of the message to register to</typeparam>
	/// <param name="recipient">The object to which the message will be delivered. This reference keeps the registration alive</param>
	/// <param name="action">The callback to invoke upon receiving a message</param>
	void Register<TMessage>(object recipient, Action<TMessage> action);

	/// <summary>
	/// Register to a given message type with an additional filter
	/// </summary>
	/// <typeparam name="TMessage">The type of the message to register to</typeparam>
	/// <param name="recipient">The object to which the message will be delivered. This reference keeps the registration alive</param>
{'fraction_non_alphanumeric': 0.1021984551396316, 'fraction_numerical': 0.0, 'mean_word_length': 4.404494382022472, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4245681', 'n_tokens_mistral': 859, 'n_tokens_neox': 815, 'n_words': 397}