Skip to content

Commit

Permalink
chore(willmsg): add come comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Nov 22, 2023
1 parent e11bd4a commit a0c8c06
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions apps/emqx/src/emqx_channel.erl
Expand Up @@ -2209,23 +2209,26 @@ ensure_disconnected(
%% - EMQX operations on the client
%% @NOTE:
%% Connection close with session expiry interval = 0 means session close.
%% @NOTE:
%% The caller does not need to take care of the case when process terminates while will_msg is published
%% as it is designed by the spec.
-spec maybe_publish_will_msg(Reason, channel()) -> channel() when
Reason ::
%% Connection will terminate because session is taken over by another process.
%% Connection is terminating because session is taken over by another process.
takenover
%% Connection will terminate because of EMQX mgmt operation, also delete the session.
%% Connection is terminating because of EMQX mgmt operation, also delete the session.
| kicked
%% Connection will terminate because session is taken over by another process.
%% Connection is terminating because session is taken over by another process.
| discarded
%% Connection will terminate because session is expired
%% Connection is terminating because session is expired
| expired
%% Connection will terminate because of socket close/error
%% Connection is terminating because of socket close/error
| sock_closed
%% Connection will terminate with Reasons
%% Connection is terminating with Reasons
| {shutdown, atom()}
%% Connection will terminate soon, delay willmsg publish is impossible.
%% Connection is terminating, delay willmsg publish is impossible.
| ?chan_terminating
%% Connection will terminate because of normal MQTT disconnection, implies delete the session.
%% Connection is terminating because of normal MQTT disconnection, implies delete the session.
| normal.
maybe_publish_will_msg(normal, Channel) ->
%% [MQTT-3.1.2-8]
Expand Down

0 comments on commit a0c8c06

Please sign in to comment.