0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This library provides an interface for event sourcing over a pluggable back end data store. Currently it supports the Sequel gem and its data stores as well as an in-memory data store for testing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 2.11
~> 3.40
~> 1.1

Runtime

 Project Readme

HistoryBook Build Status

HistoryBook is a ruby implementation of the event sourcing pattern.

This library provides an interface for event sourcing over a pluggable back end data store. Currently it supports the Sequel gem and its data stores as well as an in-memory data store for testing.

Usage

To run the example below you will need to install (or place in your Gemfile) both the sequel gem and the pg gem.

HistoryBook.configure(:sequel) do |config|
  config.connection_string = 'postgres://localhost/history_book'
end

HistoryBook.open('test_id') do |stream|
  stream << HistoryBook::Event.new(:customer_created, :name => 'Joe Tester', :address => '100 West Washington')
  stream.commit
end

HistoryBook.open('test_id') do |stream|
  stream.events.each do |event|
    puts "Playback event #{event.type} with #{event.data.inspect}"
  end
end