-
Notifications
You must be signed in to change notification settings - Fork 5
Test
bronzeboyvn edited this page Jan 24, 2014
·
2 revisions
Module boss_cache_adapter_ets show how ChicagoBoss uses ets_cache. After build all modules in src/, standing in erlang shell, you can run
Options = [{ets_maxsize, 3*1024}, {ets_threshold, 0.85}, {ets_weight, 30}].
{ok, Conn} = boss_cache_adapter_ets:init(Options).
boss_cache_adapter_ets:set(Conn, "Key", "010", "Val10", 60).
boss_cache_adapter_ets:set(Conn, "Key", "011", "Val11", 60).
boss_cache_adapter_ets:set(Conn, "Key", "012", "Val12", 60).
boss_cache_adapter_ets:get(Conn, "Key", "011").
boss_cache_adapter_ets:set(Conn, "Key", "013", "Val13", 60).
boss_cache_adapter_ets:get(Conn, "Key", "010").
boss_cache_adapter_ets:set(Conn, "Key", "014", "Val14", 60).
boss_cache_adapter_ets:set(Conn, "Key", "015", "Val15", 60).
boss_cache_adapter_ets:delete(Conn, "Key", "015").
boss_cache_adapter_ets:terminate(Conn).