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 <[email protected]>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: [email protected] > jabber: [email protected] > > -- > Juju mailing list > [email protected] > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/juju >
-- Juju mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju
