Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Configuration

Samuel Debruyn edited this page Nov 27, 2015 · 2 revisions

All you need to configure is the Command Processor, you use it to configure every aspect of Cirqus. The fluent configuration API is very extensive, but you don't need to know every possible configuration option to get started.

The configuration of Cirqus has to happen exactly once and the processor should then globally be available. One possibility is to use dependency injection to make this happen. In a web application, the configuration is best put in Application_Start in Global.asax.cs or a method called by Application_Start.

Minimum required configuration

var processor = CommandProcessor.With()
				.EventStore(c => c.UseSqlServer(connectionStringOrConnectionStringName, eventsTableName))
				.EventDispatcher(c => c.UseViewManagerEventDispatcher(viewManagers))
				.Create();

In the example above the events are stored in SQL Server. The event store configuration requires 2 parameters:

  • the connection string or the name of the connection string for the database
  • the name of the table contains the events

Cirqus will create the table itself if it doesn't exist.

The event dispatcher requires an array of all the view managers you will be using.

The Create method finished the configuration and starts a thread for every event dispatcher (just one in the example above). The default catchup time is 1000 ms. This means that every second, the second thread checks for new events in the event store and dispatches them to all the view managers.

Clone this wiki locally