docs: note that connector state must be immutable to avoid errors
This commit is contained in:
parent
ba96c725e5
commit
ffce6fefa8
|
@ -141,6 +141,9 @@ connect(Opts0) ->
|
||||||
{Topic, MQTTConfig} = lists:nth(Index, TopicMappingList),
|
{Topic, MQTTConfig} = lists:nth(Index, TopicMappingList),
|
||||||
Config = #{
|
Config = #{
|
||||||
ack_retry_interval => AckRetryInterval,
|
ack_retry_interval => AckRetryInterval,
|
||||||
|
%% Note: the `connector_state' value here must be immutable and not changed by the
|
||||||
|
%% bridge during `on_get_status', since we have handed it over to the pull
|
||||||
|
%% workers.
|
||||||
connector_state => ConnectorState,
|
connector_state => ConnectorState,
|
||||||
hookpoint => Hookpoint,
|
hookpoint => Hookpoint,
|
||||||
instance_id => InstanceId,
|
instance_id => InstanceId,
|
||||||
|
|
|
@ -69,6 +69,8 @@ on_stop(InstanceId, undefined = _State) ->
|
||||||
|
|
||||||
-spec on_get_status(resource_id(), state()) -> connected | disconnected.
|
-spec on_get_status(resource_id(), state()) -> connected | disconnected.
|
||||||
on_get_status(InstanceId, _State) ->
|
on_get_status(InstanceId, _State) ->
|
||||||
|
%% Note: do *not* alter the `connector_state' value here. It must be immutable, since
|
||||||
|
%% we have handed it over to the pull workers.
|
||||||
case
|
case
|
||||||
emqx_resource_pool:health_check_workers(
|
emqx_resource_pool:health_check_workers(
|
||||||
InstanceId,
|
InstanceId,
|
||||||
|
|
Loading…
Reference in New Issue