anchor.diff:  broadcast_members(Timeout) ->
       gen_server:call(?SERVER, broadcast_members, Timeout).
   
  +%% @doc return a list of exchanges, started by broadcast on thisnode, that are running
  +-spec exchanges() -> exchanges().
  +exchanges() ->
  +    exchanges(node()).
  +
  +%% @doc returns a list of exchanges, started by broadcast on `Node', that are running
  +-spec exchanges(node()) -> exchanges().
  +exchanges(Node) ->
  +    gen_server:call({?SERVER, Node}, exchanges, infinity).
  +
  +%% @doc cancel exchanges started by this node.
  +-spec cancel_exchanges(all              |
  +                       {peer, node()}   |
  +                       {mod, module()}  |
  +                       reference()      |
  +                       pid()) -> exchanges().
  +cancel_exchanges(WhichExchanges) ->
  +    gen_server:call(?SERVER, {cancel_exchanges, WhichExchanges}, infinity).
  +
   %%%===================================================================
   %%% Debug API
   %%%===================================================================
  
positive.code:          broadcast/2,
           ring_update/1,
           broadcast_members/0,
           broadcast_members/1]).
  
  %% Debug API
  -export([debug_get_peers/2,
  
negative.code:              end,
      State1#state{mods=Mods ++ [Mod]}.
  
  cancel_exchanges(all, Exchanges) ->
      kill_exchanges(Exchanges);
  cancel_exchanges(WhichProc, Exchanges) when is_reference(WhichProc) orelse
                                              is_pid(WhichProc) ->
      KeyPos = case is_reference(WhichProc) of
                true -> 3;
                false -> 4
            end,
      case lists:keyfind(WhichProc, KeyPos, Exchanges) of
          false -> [];
          Exchange ->
              kill_exchange(Exchange),
              [Exchange]
      end;
  cancel_exchanges(Which, Exchanges) ->
      Filter = exchange_filter(Which),
      ToCancel = [Ex || Ex <- Exchanges, Filter(Ex)],
      kill_exchanges(ToCancel).
  
  kill_exchanges(Exchanges) ->
      [kill_exchange(Exchange) || Exchange <- Exchanges],
      Exchanges.
  
  kill_exchange({_, _, _, ExchangePid}) ->
      exit(ExchangePid, cancel_exchange).
  
  
  exchange_filter({peer, Peer}) ->
      fun({_, ExchangePeer, _, _}) ->
              Peer =:= ExchangePeer
      end;
  exchange_filter({mod, Mod}) ->
      fun({ExchangeMod, _, _, _}) ->
              Mod =:= ExchangeMod
      end.
  
  
  %% picks random root uniformly
  random_root(#state{all_members=Members}) ->
      random_other_node(Members).
  