|
87 | 87 |
|
88 | 88 | -opaque state() :: #state{}. |
89 | 89 |
|
| 90 | +-type info_commands() :: host | port | peer_host | peer_port |
| 91 | + | connected_at | ssl_login_name | vhost | user_who_performed_action | user |
| 92 | + | clean_sess | will_msg | retainer_pid | exchange | prefetch |
| 93 | + | messages_unconfirmed | messages_unacknowledged |
| 94 | + | node |
| 95 | + | client_id | client_properties |
| 96 | + | channel_max | frame_max | auth_mechanism. |
| 97 | + |
90 | 98 | -spec initial_state(Socket :: any(), ConnectionName :: binary()) -> |
91 | 99 | state(). |
92 | 100 | initial_state(Socket, ConnectionName) -> |
@@ -1329,9 +1337,13 @@ serialise_and_send_to_client(Packet, #state{cfg = #cfg{proto_ver = ProtoVer, |
1329 | 1337 | [Sock, Error, Packet#mqtt_packet.fixed, Packet#mqtt_packet.variable]) |
1330 | 1338 | end. |
1331 | 1339 |
|
| 1340 | +-spec serialise(#mqtt_packet{}, state()) -> |
| 1341 | + iodata(). |
1332 | 1342 | serialise(Packet, #state{cfg = #cfg{proto_ver = ProtoVer}}) -> |
1333 | 1343 | rabbit_mqtt_packet:serialise(Packet, ProtoVer). |
1334 | 1344 |
|
| 1345 | +-spec terminate(any(), binary(), atom(),rabbit_mqtt_processor:state()) -> |
| 1346 | + ok. |
1335 | 1347 | terminate(SendWill, ConnName, ProtoFamily, State) -> |
1336 | 1348 | maybe_send_will(SendWill, ConnName, State), |
1337 | 1349 | Infos = [{name, ConnName}, |
@@ -1427,11 +1439,15 @@ delete_queue(QName, Username) -> |
1427 | 1439 | ok |
1428 | 1440 | end). |
1429 | 1441 |
|
| 1442 | +-spec handle_pre_hibernate() -> ok. |
1430 | 1443 | handle_pre_hibernate() -> |
1431 | 1444 | erase(permission_cache), |
1432 | 1445 | erase(topic_permission_cache), |
1433 | 1446 | ok. |
1434 | 1447 |
|
| 1448 | +-spec handle_ra_event(register_timeout |
| 1449 | +| {applied, [{reference(), ok}]} |
| 1450 | +| {not_leader, term(), reference()}, state()) -> state(). |
1435 | 1451 | handle_ra_event({applied, [{Corr, ok}]}, |
1436 | 1452 | State = #state{register_state = {pending, Corr}}) -> |
1437 | 1453 | %% success case - command was applied transition into registered state |
@@ -1796,6 +1812,7 @@ throttle(Conserve, Connected, #state{queues_soft_limit_exceeded = QSLE, |
1796 | 1812 | not sets:is_empty(QSLE) orelse |
1797 | 1813 | credit_flow:blocked(). |
1798 | 1814 |
|
| 1815 | +-spec info(info_commands(), state()) -> any. |
1799 | 1816 | info(host, #state{cfg = #cfg{host = Val}}) -> Val; |
1800 | 1817 | info(port, #state{cfg = #cfg{port = Val}}) -> Val; |
1801 | 1818 | info(peer_host, #state{cfg = #cfg{peer_host = Val}}) -> Val; |
|
0 commit comments