summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hood <0x6e6562@gmail.com>2008-08-05 13:07:26 +0100
committerBen Hood <0x6e6562@gmail.com>2008-08-05 13:07:26 +0100
commit837b2f545158dc07cbf855ed7782468839240db5 (patch)
treeff9c5c1b925547e121cbd7db352c0e91285ca4ed
parent7c0f2eaaa36c8b4fa54e155090cc5a49c10ecd15 (diff)
downloadrabbitmq-server-837b2f545158dc07cbf855ed7782468839240db5.tar.gz
Fixed specification for declare
-rw-r--r--src/rabbit_amqqueue.erl8
-rw-r--r--src/rabbit_exchange.erl14
2 files changed, 11 insertions, 11 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index c3fac998..f19249f6 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -55,7 +55,7 @@
{'error', 'queue_not_found' | 'exchange_not_found'}).
-spec(start/0 :: () -> 'ok').
-spec(recover/0 :: () -> 'ok').
--spec(declare/4 :: (name(), bool(), bool(), amqp_table()) ->
+-spec(declare/4 :: (r(amqqueue), bool(), bool(), amqp_table()) ->
amqqueue()).
-spec(add_binding/4 ::
(queue_name(), exchange_name(), routing_key(), amqp_table()) ->
@@ -249,7 +249,7 @@ with(Name, F, E) ->
end.
with(Name, F) ->
- with(Name, F, fun () -> {error, not_found} end).
+ with(Name, F, fun () -> {error, not_found} end).
with_or_die(Name, F) ->
with(Name, F, fun () -> rabbit_misc:protocol_error(
not_found, "no ~s", [rabbit_misc:rs(Name)])
@@ -351,8 +351,8 @@ delete_temp(Q = #amqqueue{name = QueueName}) ->
delete_queue(Q = #amqqueue{}) ->
ok = delete_temp(Q).
-
-on_node_down(Node) ->
+
+on_node_down(Node) ->
rabbit_misc:execute_mnesia_transaction(
fun () ->
qlc:fold(
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index 17d9fd97..ccda0d36 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -50,21 +50,21 @@
not_found() | {'error', 'unroutable' | 'not_delivered'}).
-spec(recover/0 :: () -> 'ok').
--spec(declare/5 :: (name(), exchange_type(), bool(), bool(),
+-spec(declare/5 :: (r(exchange), exchange_type(), bool(), bool(),
amqp_table()) -> exchange()).
-spec(check_type/1 :: (binary()) -> atom()).
--spec(assert_type/2 :: (exchange(), atom()) -> 'ok').
+-spec(assert_type/2 :: (exchange(), atom()) -> 'ok').
-spec(lookup/1 :: (exchange_name()) -> {'ok', exchange()} | not_found()).
-spec(lookup_or_die/1 :: (exchange_name()) -> exchange()).
-spec(list_vhost_exchanges/1 :: (vhost()) -> [exchange()]).
--spec(list_exchange_bindings/1 :: (exchange_name()) ->
+-spec(list_exchange_bindings/1 :: (exchange_name()) ->
[{queue_name(), routing_key(), amqp_table()}]).
-spec(simple_publish/6 ::
(bool(), bool(), exchange_name(), routing_key(), binary(), binary()) ->
publish_res()).
-spec(simple_publish/3 :: (bool(), bool(), message()) -> publish_res()).
-spec(route/2 :: (exchange(), routing_key()) -> [pid()]).
--spec(add_binding/2 :: (binding_spec(), amqqueue()) ->
+-spec(add_binding/2 :: (binding_spec(), amqqueue()) ->
'ok' | not_found() |
{'error', 'durability_settings_incompatible'}).
-spec(delete_binding/2 :: (binding_spec(), amqqueue()) ->
@@ -184,7 +184,7 @@ simple_publish(Mandatory, Immediate,
%% return the list of qpids to which a message with a given routing
%% key, sent to a particular exchange, should be delivered.
-%%
+%%
%% The function ensures that a qpid appears in the return list exactly
%% as many times as a message should be delivered to it. With the
%% current exchange types that is at most once.
@@ -194,7 +194,7 @@ route(#exchange{name = Name, type = topic}, RoutingKey) ->
mnesia:activity(
async_dirty,
fun () ->
- qlc:e(qlc:q([handler_qpids(H) ||
+ qlc:e(qlc:q([handler_qpids(H) ||
#binding{key = {Name1, PatternKey},
handlers = H}
<- mnesia:table(binding),
@@ -287,7 +287,7 @@ add_handler_to_binding(BindingKey, Handler) ->
ok = mnesia:write(
B#binding{handlers = extend_handlers(H, Handler)})
end.
-
+
%% Must run within a transaction.
remove_handler_from_binding(BindingKey, Handler) ->
case mnesia:wread({binding, BindingKey}) of