~txuls-dev/txuls/soom

« back to all changes in this revision

Viewing changes to docs/patterns/01-group-with-basic-governance.txt

  • Committer: duncan at ubuntu
  • Date: 2011-07-09 16:03:02 UTC
  • Revision ID: duncan@ubuntu.com-20110709160302-ubxig9zxveq43yil
* Filled in text for each pattern.
* Started filling in code for pattern 1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Pattern 1 - Primary Group with Basic Governance
 
2
-----------------------------------------------
 
3
 
 
4
Set up the preliminaries::
 
5
 
 
6
    >>> from twisted.python import log
 
7
    >>>
 
8
    >>> catcher = []
 
9
    >>> observer = catcher.append
 
10
    >>> log.addObserver(observer)
 
11
 
 
12
    >>> def printMessages():
 
13
    ...     while catcher:
 
14
    ...         logged = catcher.pop(0)
 
15
    ...         print logged.get("message")[0]
 
16
 
 
17
    >>> from txsoom.network import BroadcastNetwork
 
18
    >>> from txsoom.peer import Peer
 
19
    >>>
 
20
    >>> bNet = BroadcastNetwork()
 
21
 
 
22
Create a group of objects under a critical limit::
 
23
 
 
24
    >>> limit = 5
 
25
    >>> 
 
26
 
 
27
They remain as a group::
 
28
 
 
29
 
 
30
They establish communications with each other::
 
31
 
 
32
 
 
33
They Elect a proxy for communication with the outside world::
 
34
 
 
35
 
 
36