Packages
launchdarkly_server_sdk
1.0.0-beta3
3.11.0
3.10.1
3.9.0
3.8.1
3.8.0
3.7.2
3.7.1
3.7.0
3.6.0
3.5.0
3.4.0
3.3.1
3.3.0
3.2.0
3.1.0
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.1.2
2.1.1
2.1.0
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.6.0
1.5.0
1.4.0
1.3.2
1.3.1
1.3.0
1.2.0
1.1.3
1.1.2
1.1.1
retired
1.1.0
retired
1.0.1
retired
1.0.0
retired
1.0.0-beta4
retired
1.0.0-beta3
retired
1.0.0-beta2
retired
LaunchDarkly SDK for Erlang
Retired package: Deprecated - This version will not be able to connect to and communicate with LaunchDarkly after support for the HTTP/2 protocol is enabled.
Current section
Files
Jump to
Current section
Files
src/ldclient_update_processor_state.erl
%%-------------------------------------------------------------------
%% @doc `ldclient_update_processor_state' module
%%
%% @end
%%-------------------------------------------------------------------
-module(ldclient_update_processor_state).
-include("ldclient_update_processor_state.hrl").
% API
-export([init/0]).
-export([set_initialized_state/2]).
-export([get_initialized_state/1]).
%%===================================================================
%% API
%%===================================================================
%% @doc Initialize update processor initialization ETS table
%%
%% Initializes an empty ETS table for initialization state of update processors.
%% @end
-spec init() -> ok.
init() ->
_TID = ets:new(?UPDATE_PROCESSOR_INITIALIZATION_TABLE, [set, public, named_table, {read_concurrency, true}]),
ok.
%% @doc Change the update processor status for a given Tag
%%
%% @end
-spec set_initialized_state(Tag :: atom(), Value :: boolean()) -> boolean().
set_initialized_state(Tag, Value) ->
ets:insert(?UPDATE_PROCESSOR_INITIALIZATION_TABLE, {Tag, Value}).
%% @doc Return the update processor status for a given Tag
%%
%% @end
-spec get_initialized_state(Tag :: atom()) -> boolean().
get_initialized_state(Tag) ->
[{_Tag, Initialized}] = ets:lookup(?UPDATE_PROCESSOR_INITIALIZATION_TABLE, Tag),
Initialized.