Align the state record
This commit is contained in:
parent
c49e5dfddc
commit
826daace61
|
@ -68,75 +68,74 @@
|
||||||
%% Clean Start Flag
|
%% Clean Start Flag
|
||||||
clean_start = false :: boolean(),
|
clean_start = false :: boolean(),
|
||||||
|
|
||||||
|
%% Client Binding: local | remote
|
||||||
|
binding = local :: local | remote,
|
||||||
|
|
||||||
%% Client Binding: local | remote
|
%% ClientId: Identifier of Session
|
||||||
binding = local :: local | remote,
|
client_id :: binary(),
|
||||||
|
|
||||||
%% ClientId: Identifier of Session
|
%% Username
|
||||||
client_id :: binary(),
|
username :: binary() | undefined,
|
||||||
|
|
||||||
%% Username
|
%% Connection pid binding with session
|
||||||
username :: binary() | undefined,
|
conn_pid :: pid(),
|
||||||
|
|
||||||
%% Connection pid binding with session
|
%% Old Connection Pid that has been kickout
|
||||||
conn_pid :: pid(),
|
old_conn_pid :: pid(),
|
||||||
|
|
||||||
%% Old Connection Pid that has been kickout
|
%% Next packet id of the session
|
||||||
old_conn_pid :: pid(),
|
next_pkt_id = 1 :: emqx_mqtt_types:packet_id(),
|
||||||
|
|
||||||
%% Next packet id of the session
|
%% Max subscriptions
|
||||||
next_pkt_id = 1 :: emqx_mqtt_types:packet_id(),
|
max_subscriptions :: non_neg_integer(),
|
||||||
|
|
||||||
%% Max subscriptions
|
%% Client’s Subscriptions.
|
||||||
max_subscriptions :: non_neg_integer(),
|
subscriptions :: map(),
|
||||||
|
|
||||||
%% Client’s Subscriptions.
|
%% Upgrade QoS?
|
||||||
subscriptions :: map(),
|
upgrade_qos = false :: boolean(),
|
||||||
|
|
||||||
%% Upgrade QoS?
|
%% Client <- Broker: Inflight QoS1, QoS2 messages sent to the client but unacked.
|
||||||
upgrade_qos = false :: boolean(),
|
inflight :: emqx_inflight:inflight(),
|
||||||
|
|
||||||
%% Client <- Broker: Inflight QoS1, QoS2 messages sent to the client but unacked.
|
%% Max Inflight Size. DEPRECATED: Get from inflight
|
||||||
inflight :: emqx_inflight:inflight(),
|
%% max_inflight = 32 :: non_neg_integer(),
|
||||||
|
|
||||||
%% Max Inflight Size. DEPRECATED: Get from inflight
|
%% Retry interval for redelivering QoS1/2 messages
|
||||||
%% max_inflight = 32 :: non_neg_integer(),
|
retry_interval = 20000 :: timeout(),
|
||||||
|
|
||||||
%% Retry interval for redelivering QoS1/2 messages
|
%% Retry Timer
|
||||||
retry_interval = 20000 :: timeout(),
|
retry_timer :: reference() | undefined,
|
||||||
|
|
||||||
%% Retry Timer
|
%% All QoS1, QoS2 messages published to when client is disconnected.
|
||||||
retry_timer :: reference() | undefined,
|
%% QoS 1 and QoS 2 messages pending transmission to the Client.
|
||||||
|
%%
|
||||||
|
%% Optionally, QoS 0 messages pending transmission to the Client.
|
||||||
|
mqueue :: emqx_mqueue:mqueue(),
|
||||||
|
|
||||||
%% All QoS1, QoS2 messages published to when client is disconnected.
|
%% Client -> Broker: Inflight QoS2 messages received from client and waiting for pubrel.
|
||||||
%% QoS 1 and QoS 2 messages pending transmission to the Client.
|
awaiting_rel :: map(),
|
||||||
%%
|
|
||||||
%% Optionally, QoS 0 messages pending transmission to the Client.
|
|
||||||
mqueue :: emqx_mqueue:mqueue(),
|
|
||||||
|
|
||||||
%% Client -> Broker: Inflight QoS2 messages received from client and waiting for pubrel.
|
%% Max Packets Awaiting PUBREL
|
||||||
awaiting_rel :: map(),
|
max_awaiting_rel = 100 :: non_neg_integer(),
|
||||||
|
|
||||||
%% Max Packets Awaiting PUBREL
|
%% Awaiting PUBREL Timeout
|
||||||
max_awaiting_rel = 100 :: non_neg_integer(),
|
await_rel_timeout = 20000 :: timeout(),
|
||||||
|
|
||||||
%% Awaiting PUBREL Timeout
|
%% Awaiting PUBREL Timer
|
||||||
await_rel_timeout = 20000 :: timeout(),
|
await_rel_timer :: reference() | undefined,
|
||||||
|
|
||||||
%% Awaiting PUBREL Timer
|
%% Session Expiry Interval
|
||||||
await_rel_timer :: reference() | undefined,
|
expiry_interval = 7200000 :: timeout(),
|
||||||
|
|
||||||
%% Session Expiry Interval
|
%% Expired Timer
|
||||||
expiry_interval = 7200000 :: timeout(),
|
expiry_timer :: reference() | undefined,
|
||||||
|
|
||||||
%% Expired Timer
|
%% Enable Stats
|
||||||
expiry_timer :: reference() | undefined,
|
enable_stats :: boolean(),
|
||||||
|
|
||||||
%% Enable Stats
|
%% Stats timer
|
||||||
enable_stats :: boolean(),
|
stats_timer :: reference() | undefined,
|
||||||
|
|
||||||
%% Stats timer
|
|
||||||
stats_timer :: reference() | undefined,
|
|
||||||
|
|
||||||
%% Deliver stats
|
%% Deliver stats
|
||||||
deliver_stats = 0,
|
deliver_stats = 0,
|
||||||
|
@ -144,10 +143,9 @@
|
||||||
%% Enqueue stats
|
%% Enqueue stats
|
||||||
enqueue_stats = 0,
|
enqueue_stats = 0,
|
||||||
|
|
||||||
|
%% Created at
|
||||||
%% Created at
|
created_at :: erlang:timestamp()
|
||||||
created_at :: erlang:timestamp()
|
}).
|
||||||
}).
|
|
||||||
|
|
||||||
-define(TIMEOUT, 60000).
|
-define(TIMEOUT, 60000).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue