View Source nova_session_ets (nova v0.9.15)

Link to this section Summary

Functions

Convert process state when code is changed
This function is called for changing the form and appearance of gen_server status when it is returned from sys:get_status/1,2 or when it appears in termination error logs.
Handling call messages
Handling cast messages
Handling all non call/cast messages
Initializes the server
Starts the server
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

View Source
-spec code_change(OldVsn :: term() | {down, term()}, State :: term(), Extra :: term()) ->
               {ok, NewState :: term()} | {error, Reason :: term()}.
Convert process state when code is changed
-spec delete_value(SessionId :: binary()) -> ok | {error, Reason :: term()}.
Link to this function

delete_value(SessionId, Key)

View Source
-spec delete_value(SessionId :: binary(), Key :: binary()) -> ok | {error, Reason :: term()}.
Link to this function

format_status(Opt, Status)

View Source
-spec format_status(Opt :: normal | terminate, Status :: list()) -> Status :: term().
This function is called for changing the form and appearance of gen_server status when it is returned from sys:get_status/1,2 or when it appears in termination error logs.
Link to this function

get_value(SessionId, Key)

View Source
-spec get_value(SessionId :: binary(), Key :: binary()) -> {ok, Value :: binary()} | {error, not_found}.
Link to this function

handle_call(Request, From, State)

View Source
-spec handle_call(Request :: term(), From :: {pid(), term()}, State :: term()) ->
               {reply, Reply :: term(), NewState :: term()} |
               {reply, Reply :: term(), NewState :: term(), Timeout :: timeout()} |
               {reply, Reply :: term(), NewState :: term(), hibernate} |
               {noreply, NewState :: term()} |
               {noreply, NewState :: term(), Timeout :: timeout()} |
               {noreply, NewState :: term(), hibernate} |
               {stop, Reason :: term(), Reply :: term(), NewState :: term()} |
               {stop, Reason :: term(), NewState :: term()}.
Handling call messages
Link to this function

handle_cast(Request, State)

View Source
-spec handle_cast(Request :: term(), State :: term()) ->
               {noreply, NewState :: term()} |
               {noreply, NewState :: term(), Timeout :: timeout()} |
               {noreply, NewState :: term(), hibernate} |
               {stop, Reason :: term(), NewState :: term()}.
Handling cast messages
Link to this function

handle_info(Info, State)

View Source
-spec handle_info(Info :: timeout() | term(), State :: term()) ->
               {noreply, NewState :: term()} |
               {noreply, NewState :: term(), Timeout :: timeout()} |
               {noreply, NewState :: term(), hibernate} |
               {stop, Reason :: normal | term(), NewState :: term()}.
Handling all non call/cast messages
-spec init(Args :: term()) ->
        {ok, State :: term()} |
        {ok, State :: term(), Timeout :: timeout()} |
        {ok, State :: term(), hibernate} |
        {stop, Reason :: term()} |
        ignore.
Initializes the server
Link to this function

set_value(SessionId, Key, Value)

View Source
-spec set_value(SessionId :: binary(), Key :: binary(), Value :: binary()) ->
             ok | {error, Reason :: term()}.
-spec start_link() ->
              {ok, Pid :: pid()} |
              {error, Error :: {already_started, pid()}} |
              {error, Error :: term()} |
              ignore.
Starts the server
Link to this function

terminate(Reason, State)

View Source
-spec terminate(Reason :: normal | shutdown | {shutdown, term()} | term(), State :: term()) -> any().
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.