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()

items/1

items(Id) -> any()

  • Id = atom()

Return server’s items

put/3

put(Id, Key, Value) -> ok | {error, any()}

  • Id = atom()
  • Key = binary()
  • Value = binary()

Insert a key-value pair into the leo_mcerl

size/1

size(Id) -> any()

  • Id = atom()

Return server’s summary of cache size

stats/1

stats(Id) -> any()

  • Id = atom()

Return server’s state

stop/1

stop(Id) -> ok

  • Id = atom()

Stop the server

terminate/2

terminate(Reason, State) -> any()