Created
April 24, 2014 16:19
-
-
Save ahawkins/11260461 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PostRepo | |
| extend Chassis::Repo::Delegation | |
| class << self | |
| def backend | |
| PostStore.instance | |
| end | |
| end | |
| end | |
| class StatRepo | |
| extend Chassis::Repo::Delegation | |
| class << self | |
| def backend | |
| StatStore.instance | |
| end | |
| end | |
| end | |
| class StatStore < Chassis::BaseRepo | |
| include Singleton | |
| end | |
| class PostStore < Chassis::BaseRepo | |
| include Singleton | |
| end | |
| PostStore.instance.use :memory | |
| StatStore.instance.use :memory | |
| # Anything w/o backend redefined will go here | |
| Chassis.repo.use :memory | |
| class RedisStatStore | |
| # blah blah | |
| end | |
| class NoegraphyPostStore | |
| # blah blah | |
| end | |
| PostStore.instance.register :neography, NeographyPostStore.new | |
| StatStore.instance.register :redis, RedisStatsStore.new | |
| # then you can use :redis, or :neography as appriorate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment