diff options
author | John DeTreville <jdetreville@vmware.com> | 2010-11-10 14:56:12 +0000 |
---|---|---|
committer | John DeTreville <jdetreville@vmware.com> | 2010-11-10 14:56:12 +0000 |
commit | 618fd89d2b5603b9ed766651be88fd09bf5fad64 (patch) | |
tree | 94b43ecc98b74b9fe6f7166a6a3cf781091b3d92 | |
parent | 66557f7656d01aa2928ec6cd3b13fe732c92755f (diff) | |
download | rabbitmq-server-618fd89d2b5603b9ed766651be88fd09bf5fad64.tar.gz |
Added rabbit_types:{infos,info_keys} and used them as appropriate.
-rw-r--r-- | src/rabbit_amqqueue.erl | 14 | ||||
-rw-r--r-- | src/rabbit_binding.erl | 14 | ||||
-rw-r--r-- | src/rabbit_channel.erl | 10 | ||||
-rw-r--r-- | src/rabbit_exchange.erl | 14 | ||||
-rw-r--r-- | src/rabbit_networking.erl | 14 | ||||
-rw-r--r-- | src/rabbit_reader.erl | 6 | ||||
-rw-r--r-- | src/rabbit_types.erl | 7 |
7 files changed, 42 insertions, 37 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 9d78bafa..45d14a97 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -97,14 +97,14 @@ -spec(with_exclusive_access_or_die/3 :: (name(), pid(), qfun(A)) -> A | rabbit_types:channel_exit()). -spec(list/1 :: (rabbit_types:vhost()) -> [rabbit_types:amqqueue()]). --spec(info_keys/0 :: () -> [rabbit_types:info_key()]). --spec(info/1 :: (rabbit_types:amqqueue()) -> [rabbit_types:info()]). +-spec(info_keys/0 :: () -> rabbit_types:info_keys()). +-spec(info/1 :: (rabbit_types:amqqueue()) -> rabbit_types:infos()). -spec(info/2 :: - (rabbit_types:amqqueue(), [rabbit_types:info_key()]) - -> [rabbit_types:info()]). --spec(info_all/1 :: (rabbit_types:vhost()) -> [[rabbit_types:info()]]). --spec(info_all/2 :: (rabbit_types:vhost(), [rabbit_types:info_key()]) - -> [[rabbit_types:info()]]). + (rabbit_types:amqqueue(), rabbit_types:info_keys()) + -> rabbit_types:infos()). +-spec(info_all/1 :: (rabbit_types:vhost()) -> [rabbit_types:infos()]). +-spec(info_all/2 :: (rabbit_types:vhost(), rabbit_types:info_keys()) + -> [rabbit_types:infos()]). -spec(consumers/1 :: (rabbit_types:amqqueue()) -> [{pid(), rabbit_types:ctag(), boolean()}]). diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index 1af213c4..3765a088 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -78,13 +78,13 @@ -spec(list_for_source_and_destination/2 :: (rabbit_types:binding_source(), rabbit_types:binding_destination()) -> bindings()). --spec(info_keys/0 :: () -> [rabbit_types:info_key()]). --spec(info/1 :: (rabbit_types:binding()) -> [rabbit_types:info()]). --spec(info/2 :: (rabbit_types:binding(), [rabbit_types:info_key()]) -> - [rabbit_types:info()]). --spec(info_all/1 :: (rabbit_types:vhost()) -> [[rabbit_types:info()]]). --spec(info_all/2 ::(rabbit_types:vhost(), [rabbit_types:info_key()]) - -> [[rabbit_types:info()]]). +-spec(info_keys/0 :: () -> rabbit_types:info_keys()). +-spec(info/1 :: (rabbit_types:binding()) -> rabbit_types:infos()). +-spec(info/2 :: (rabbit_types:binding(), rabbit_types:info_keys()) -> + rabbit_types:infos()). +-spec(info_all/1 :: (rabbit_types:vhost()) -> [rabbit_types:infos()]). +-spec(info_all/2 ::(rabbit_types:vhost(), rabbit_types:info_keys()) + -> [rabbit_types:infos()]). -spec(has_for_source/1 :: (rabbit_types:binding_source()) -> boolean()). -spec(remove_for_source/1 :: (rabbit_types:binding_source()) -> bindings()). -spec(remove_for_destination/1 :: diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 873268cd..99837609 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -93,11 +93,11 @@ -> 'ok'). -spec(flushed/2 :: (pid(), pid()) -> 'ok'). -spec(list/0 :: () -> [pid()]). --spec(info_keys/0 :: () -> [rabbit_types:info_key()]). --spec(info/1 :: (pid()) -> [rabbit_types:info()]). --spec(info/2 :: (pid(), [rabbit_types:info_key()]) -> [rabbit_types:info()]). --spec(info_all/0 :: () -> [[rabbit_types:info()]]). --spec(info_all/1 :: ([rabbit_types:info_key()]) -> [[rabbit_types:info()]]). +-spec(info_keys/0 :: () -> rabbit_types:info_keys()). +-spec(info/1 :: (pid()) -> rabbit_types:infos()). +-spec(info/2 :: (pid(), rabbit_types:info_keys()) -> rabbit_types:infos()). +-spec(info_all/0 :: () -> [rabbit_types:infos()]). +-spec(info_all/1 :: (rabbit_types:info_keys()) -> [rabbit_types:infos()]). -spec(emit_stats/1 :: (pid()) -> 'ok'). -endif. diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 46564233..61a24388 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -68,14 +68,14 @@ (name()) -> rabbit_types:exchange() | rabbit_types:channel_exit()). -spec(list/1 :: (rabbit_types:vhost()) -> [rabbit_types:exchange()]). --spec(info_keys/0 :: () -> [rabbit_types:info_key()]). --spec(info/1 :: (rabbit_types:exchange()) -> [rabbit_types:info()]). +-spec(info_keys/0 :: () -> rabbit_types:info_keys()). +-spec(info/1 :: (rabbit_types:exchange()) -> rabbit_types:infos()). -spec(info/2 :: - (rabbit_types:exchange(), [rabbit_types:info_key()]) - -> [rabbit_types:info()]). --spec(info_all/1 :: (rabbit_types:vhost()) -> [[rabbit_types:info()]]). --spec(info_all/2 ::(rabbit_types:vhost(), [rabbit_types:info_key()]) - -> [[rabbit_types:info()]]). + (rabbit_types:exchange(), rabbit_types:info_keys()) + -> rabbit_types:infos()). +-spec(info_all/1 :: (rabbit_types:vhost()) -> [rabbit_types:infos()]). +-spec(info_all/2 ::(rabbit_types:vhost(), rabbit_types:info_keys()) + -> [rabbit_types:infos()]). -spec(publish/2 :: (rabbit_types:exchange(), rabbit_types:delivery()) -> {rabbit_router:routing_result(), [pid()]}). -spec(delete/2 :: diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index 03a9b386..1c542ffe 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -67,21 +67,21 @@ -spec(start/0 :: () -> 'ok'). -spec(start_tcp_listener/2 :: (hostname(), ip_port()) -> 'ok'). --spec(start_ssl_listener/3 :: (hostname(), ip_port(), [rabbit_types:info()]) +-spec(start_ssl_listener/3 :: (hostname(), ip_port(), rabbit_types:infos()) -> 'ok'). -spec(stop_tcp_listener/2 :: (hostname(), ip_port()) -> 'ok'). -spec(active_listeners/0 :: () -> [rabbit_types:listener()]). -spec(node_listeners/1 :: (node()) -> [rabbit_types:listener()]). -spec(connections/0 :: () -> [rabbit_types:connection()]). --spec(connection_info_keys/0 :: () -> [rabbit_types:info_key()]). +-spec(connection_info_keys/0 :: () -> rabbit_types:info_keys()). -spec(connection_info/1 :: - (rabbit_types:connection()) -> [rabbit_types:info()]). + (rabbit_types:connection()) -> rabbit_types:infos()). -spec(connection_info/2 :: - (rabbit_types:connection(), [rabbit_types:info_key()]) - -> [rabbit_types:info()]). --spec(connection_info_all/0 :: () -> [[rabbit_types:info()]]). + (rabbit_types:connection(), rabbit_types:info_keys()) + -> rabbit_types:infos()). +-spec(connection_info_all/0 :: () -> [rabbit_types:infos()]). -spec(connection_info_all/1 :: - ([rabbit_types:info_key()]) -> [[rabbit_types:info()]]). + (rabbit_types:info_keys()) -> [rabbit_types:infos()]). -spec(close_connection/2 :: (pid(), string()) -> 'ok'). -spec(on_node_down/1 :: (node()) -> 'ok'). -spec(check_tcp_listener_address/3 :: diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 127467bb..afc383d6 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -168,9 +168,9 @@ -spec(start_link/3 :: (pid(), pid(), start_heartbeat_fun()) -> rabbit_types:ok(pid())). --spec(info_keys/0 :: () -> [rabbit_types:info_key()]). --spec(info/1 :: (pid()) -> [rabbit_types:info()]). --spec(info/2 :: (pid(), [rabbit_types:info_key()]) -> [rabbit_types:info()]). +-spec(info_keys/0 :: () -> rabbit_types:info_keys()). +-spec(info/1 :: (pid()) -> rabbit_types:infos()). +-spec(info/2 :: (pid(), rabbit_types:info_keys()) -> rabbit_types:infos()). -spec(emit_stats/1 :: (pid()) -> 'ok'). -spec(shutdown/2 :: (pid(), string()) -> 'ok'). -spec(conserve_memory/2 :: (pid(), boolean()) -> 'ok'). diff --git a/src/rabbit_types.erl b/src/rabbit_types.erl index edc73f70..ec0f4692 100644 --- a/src/rabbit_types.erl +++ b/src/rabbit_types.erl @@ -1,4 +1,5 @@ %% The contents of this file are subject to the Mozilla Public License + %% Version 1.1 (the "License"); you may not use this file except in %% compliance with the License. You may obtain a copy of the License at %% http://www.mozilla.org/MPL/ @@ -35,7 +36,8 @@ -ifdef(use_specs). --export_type([txn/0, maybe/1, info/0, info_key/0, message/0, basic_message/0, +-export_type([txn/0, maybe/1, info/0, infos/0, info_key/0, info_keys/0, + message/0, basic_message/0, delivery/0, content/0, decoded_content/0, undecoded_content/0, unencoded_content/0, encoded_content/0, message_properties/0, vhost/0, ctag/0, amqp_error/0, r/1, r2/2, r3/3, listener/0, @@ -95,7 +97,10 @@ -type(txn() :: rabbit_guid:guid()). -type(info_key() :: atom()). +-type(info_keys() :: [info_key()]). + -type(info() :: {info_key(), any()}). +-type(infos() :: [info()]). -type(amqp_error() :: #amqp_error{name :: rabbit_framing:amqp_exception(), |