Permalink
Browse files

make forking of eventdispatching configurable

  • Loading branch information...
1 parent 465af17 commit a86da9aeb805460ae4c50f2a5d11b97450c22b3f Adriano Raiano committed Jan 7, 2013
Showing with 7 additions and 3 deletions.
  1. +1 −0 .travis.yml
  2. +1 −0 README.markdown
  3. +4 −2 lib/eventStore.js
  4. +1 −1 package.json
View
@@ -3,6 +3,7 @@ before_script: "npm install --dev"
language: node_js
node_js:
- 0.6
+ - 0.8
branches:
only:
View
@@ -28,6 +28,7 @@ choose one of the existing storage implementation or provide your own:
var eventstore = require('eventstore');
var es = eventstore.createStore(); // optional pass in your options
+ // to disable forking of event dispatching set forkDispatching to false
By default the eventstore will use an inMemory Storage, a fakePublisher and no logger.
View
@@ -9,7 +9,8 @@
// var eventstore = require('[pathToEventStore]/eventStore')
// var es = eventstore.createStore({
// publishingInterval: 200, // milliseconds [optional]
-// logger: 'console' // use consoleLogger [optional]
+// logger: 'console', // use consoleLogger [optional]
+// forkDispatching: true // default is true [optional]
// });
//
// // configure the instance
@@ -48,6 +49,7 @@ eventStore.createStore = function(options) {
// ## EventStore
Store = function(options) {
this.options = options || {};
+ this.options.forkDispatching = this.options.forkDispatching !== undefined ? this.options.forkDispatching : true;
this.storage = undefined;
this.publisher = undefined;
@@ -81,7 +83,7 @@ Store.prototype = {
}
// if fork enabled, start event dispatcher as child process...
- if (this.storage.filename && this.storage.options) {
+ if (this.options.forkDispatching && this.storage.filename && this.storage.options) {
if (this.logger) {
this.logger.info('Start event dispatcher as child process!');
View
@@ -1,7 +1,7 @@
{
"author": "Jan Muehlemann, Adriano Raiano"
, "name": "eventstore"
- , "version": "0.6.0"
+ , "version": "0.6.1"
, "contributors": [
{ "name": "Jan Muehlemann", "email": "jan.muehlemann@gmail.com" },
{ "name": "Adriano Raiano", "email": "adriano@raiano.ch" }

0 comments on commit a86da9a

Please sign in to comment.