leo_mcerl_server¶
The memory cache server.
Behaviours: `gen_server <gen_server.html>`__.
References
Description¶
The memory cache server
Function Index¶
code_change/3 | |
delete/2 | Remove a key-value pair by a specified key into the leo_mcerl. |
get/2 | Retrieve a value associated with a specified key. |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
init/1 | |
items/1 | Return server’s items. |
put/3 | Insert a key-value pair into the leo_mcerl. |
size/1 | Return server’s summary of cache size. |
start_link/2 | Start the server. |
stats/1 | Return server’s state. |
stop/1 | Stop the server. |
terminate/2 |
Function Details¶
code_change/3¶
code_change(OldVsn, State, Extra) -> any()
delete/2¶
delete(Id, Key) -> ok | {error, any()}
- Id = atom()
- Key = binary()
Remove a key-value pair by a specified key into the leo_mcerl
get/2¶
get(Id, Key) -> undefined | binary() | {error, any()}
- Id = atom()
- Key = binary()
Retrieve a value associated with a specified key
handle_call/3¶
handle_call(Request, From, State) -> any()
handle_cast/2¶
handle_cast(Msg, State) -> any()
handle_info/2¶
handle_info(Info, State) -> any()
init/1¶
init(X1) -> any()
put/3¶
put(Id, Key, Value) -> ok | {error, any()}
- Id = atom()
- Key = binary()
- Value = binary()
Insert a key-value pair into the leo_mcerl
start_link/2¶
start_link(Id, CacheSize) -> {ok, pid()} | ignore | {error, any()}
- Id = atom()
- CacheSize = non_neg_integer()
Start the server
terminate/2¶
terminate(Reason, State) -> any()