relations system in juju

William Reade william.reade at canonical.com
Fri Nov 22 09:10:56 UTC 2013


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.tolstov at 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.tolstov at selfip.ru
> jabber: vase at selfip.ru
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20131122/c858baf3/attachment.html>


More information about the Juju mailing list