8080-spec declare
8181 (name (), boolean (), boolean (), rabbit_framing :amqp_table (),
8282 rabbit_types :maybe (pid ()), rabbit_types :username ()) ->
83- {'new' | 'existing' | 'absent' | ' owner_died' ,
84- rabbit_types :amqqueue ()} |
83+ {'new' | 'existing' | 'owner_died' , rabbit_types : amqqueue ()} |
84+ { 'absent' , rabbit_types :amqqueue (), absent_reason ()} |
8585 rabbit_types :channel_exit ().
8686-spec declare
8787 (name (), boolean (), boolean (), rabbit_framing :amqp_table (),
129129-spec notify_policy_changed (rabbit_types :amqqueue ()) -> 'ok' .
130130-spec consumers (rabbit_types :amqqueue ()) ->
131131 [{pid (), rabbit_types :ctag (), boolean (), non_neg_integer (),
132- rabbit_framing :amqp_table ()}].
132+ rabbit_framing :amqp_table (), binary () }].
133133-spec consumer_info_keys () -> rabbit_types :info_keys ().
134134-spec consumers_all (rabbit_types :vhost ()) ->
135135 [{name (), pid (), rabbit_types :ctag (), boolean (),
161161-spec notify_down_all (qpids (), pid ()) -> ok_or_errors ().
162162-spec notify_down_all (qpids (), pid (), non_neg_integer ()) ->
163163 ok_or_errors ().
164- -spec activate_limit_all (qpids (), pid ()) -> ok_or_errors () .
164+ -spec activate_limit_all (qpids (), pid ()) -> ok .
165165-spec basic_get (rabbit_types :amqqueue (), pid (), boolean (), pid ()) ->
166166 {'ok' , non_neg_integer (), qmsg ()} | 'empty' .
167167-spec credit
@@ -453,6 +453,8 @@ not_found_or_absent(Name) ->
453453 [Q ] -> {absent , Q , nodedown } % % Q exists on stopped node
454454 end .
455455
456+ -spec not_found_or_absent_dirty (name ()) -> not_found_or_absent ().
457+
456458not_found_or_absent_dirty (Name ) ->
457459 % % We should read from both tables inside a tx, to get a
458460 % % consistent view. But the chances of an inconsistency are small,
@@ -465,7 +467,7 @@ not_found_or_absent_dirty(Name) ->
465467with (Name , F , E ) ->
466468 with (Name , F , E , 2000 ).
467469
468- with (Name , F , E , RetriesLeft ) ->
470+ with (# resource {} = Name , F , E , RetriesLeft ) ->
469471 case lookup (Name ) of
470472 {ok , Q = # amqqueue {state = live }} when RetriesLeft =:= 0 ->
471473 % % Something bad happened to that queue, we are bailing out
@@ -527,9 +529,15 @@ retry_wait(Q = #amqqueue{pid = QPid, name = Name, state = QState}, F, E, Retries
527529with (Name , F ) -> with (Name , F , fun (E ) -> {error , E } end ).
528530
529531with_or_die (Name , F ) ->
530- with (Name , F , fun (not_found ) -> rabbit_misc :not_found (Name );
531- ({absent , Q , Reason }) -> rabbit_misc :absent (Q , Reason )
532- end ).
532+ with (Name , F , die_fun (Name )).
533+
534+ -spec die_fun (name ()) ->
535+ fun ((not_found_or_absent ()) -> no_return ()).
536+
537+ die_fun (Name ) ->
538+ fun (not_found ) -> rabbit_misc :not_found (Name );
539+ ({absent , Q , Reason }) -> rabbit_misc :absent (Q , Reason )
540+ end .
533541
534542assert_equivalence (# amqqueue {name = QName ,
535543 durable = DurableQ ,
0 commit comments