0.16 - support static subscriptions

This commit is contained in:
Feng 2016-02-02 13:36:52 +08:00
parent 5306463b7e
commit 1e852ded91
2 changed files with 18 additions and 15 deletions

View File

@ -1,5 +1,5 @@
%%%----------------------------------------------------------------------------- %%%-----------------------------------------------------------------------------
%%% Copyright (c) 2012-2016 eMQTT.IO, All Rights Reserved. %%% Copyright (c) 2012-2016 Feng Lee <feng@emqtt.io>. All Rights Reserved.
%%% %%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy %%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal %%% of this software and associated documentation files (the "Software"), to deal
@ -65,7 +65,8 @@
-record(mqtt_subscription, { -record(mqtt_subscription, {
subid :: binary() | atom(), subid :: binary() | atom(),
topic :: binary(), topic :: binary(),
qos = 0 :: 0 | 1 | 2 qos = 0 :: 0 | 1 | 2,
static = false :: boolean()
}). }).
-type mqtt_subscription() :: #mqtt_subscription{}. -type mqtt_subscription() :: #mqtt_subscription{}.
@ -113,8 +114,10 @@
msgid :: mqtt_msgid(), %% Global unique message ID msgid :: mqtt_msgid(), %% Global unique message ID
pktid :: mqtt_pktid(), %% PacketId pktid :: mqtt_pktid(), %% PacketId
topic :: binary(), %% Topic that the message is published to topic :: binary(), %% Topic that the message is published to
from :: binary() | atom(), %% ClientId of publisher from :: binary() | atom(), %% ClientId of the publisher
sender :: binary() | undefined, %% Username of the publisher
qos = 0 :: 0 | 1 | 2, %% Message QoS qos = 0 :: 0 | 1 | 2, %% Message QoS
flags = [] :: [retain | dup | sys], %% Message Flags
retain = false :: boolean(), %% Retain flag retain = false :: boolean(), %% Retain flag
dup = false :: boolean(), %% Dup flag dup = false :: boolean(), %% Dup flag
sys = false :: boolean(), %% $SYS flag sys = false :: boolean(), %% $SYS flag

View File

@ -1,5 +1,5 @@
%%%----------------------------------------------------------------------------- %%%-----------------------------------------------------------------------------
%%% Copyright (c) 2012-2016 eMQTT.IO, All Rights Reserved. %%% Copyright (c) 2012-2016 Feng Lee <feng@emqtt.io>. All Rights Reserved.
%%% %%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy %%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal %%% of this software and associated documentation files (the "Software"), to deal