Hi Vasiliy There's some moderately high-level documentation of what happens in doc/charms-in-action.txt in the juju-core source tree, but that doesn't really get into the details. If you're interested in diving through the code, the most fundamental piece is the state.RelationUnit type (state/relationunit.go): its EnterScope, LeaveScope, and Settings methods are responsible for the inputs into the system, and the Watch method (implemented in state/watcher.go) is responsible for pulling all those changes into a stream of events for consumption by the units. The worker/uniter package -- particularly relationer.go, and the relation subpackage -- are the clients responsible for turning that stream of events into actual hook executions.
At heart, it all depends on Gustavo Niemeyer's mgo driver for mongodb on golang; we manage db changes with the mgo/txn package, and (in juju-core again) the state/watcher package turns the transaction log into events consumed by the RelationUnitsWatcher. HTH William On Fri, Nov 22, 2013 at 7:20 AM, Vasiliy Tolstov <v.tols...@selfip.ru>wrote: > Hi all. I want to create simple monitoring in golang =). I'm very > interesting in relations system in juju. How can it works and what > files contains code for deal with it. Is there exists some > docs/articles about this system? > > -- > Vasiliy Tolstov, > e-mail: v.tols...@selfip.ru > jabber: v...@selfip.ru > > -- > Juju mailing list > Juju@lists.ubuntu.com > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/juju >
-- Juju mailing list Juju@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju