Here is a quick status of the barrel development. It inaugurate the “This week in Barrel” serie, available each week on this forum. Enjoy!
Last week have been busy. Barrel now is using hooks and econfig internally. Correctness is on its way.
hooks is a generic Hooks system for Erlang applications; internally it used to handle the following hooks:
after_doc_read(Doc, Db) -> Doc2 : sent after a doc has been read from the filesystem
before_doc_update(Doc, Db) -> Doc2 : sent before updating the document. Useful to modify the document before updating it to the filesystem.
db_updated(DbName) -> ok: sent when a database is updated
ddoc_updated(DbName, DDocId) -> ok: when a design document is updated
db_created(DbName) -> ok: Sent when a database is created
db_deleted(DbName) -> ok: Sent when a database is deleted
db_compacted(DbName) -> ok: Sent when a database is compacted
They allows you to augment easily barrel from with your own plugins.
couch_config have been replaced by econfig . I wanted to make that change since a long time since it simplify a lot the code base:
Also econfig is well tested. Bonus point, if you’re changing the ini file from the filesystem with your own script the config will be automatically be reloaded. You don’t need to use the HTTP api for it. Which also means you can disable it if you want.
More changes are coming. As said on irc barrel is focusing right now on improving the codebase correctness and the general performance. Next step on our roadmap are the following points: