iex> ConCache.start_link(name: :my_cache, ttl_check_interval: :timer.seconds(1), global_ttl: :timer.hours(1))
{:ok, #PID<...>}
iex> item = %ConCache.Item{ttl: :timer.seconds(60), value: %{a: 1, b: 2}}
%ConCache.Item{value: %{a: 1, b: 2}, ttl: 60000}
iex> ConCache.put :my_cache, 1, item
:ok
iex> ConCache.get :my_cache, 1
%{a: 1, b: 2}
iex> ConCache.insert_new :my_cache, 2, item
:ok
iex> ConCache.get :my_cache, 2
%ConCache.Item{value: %{a: 1, b: 2}, ttl: 60000}
Both have the same arguments in the spec arg types.
As far as I can tell,
insert_newisn't compatible withConCache.Item. I discovered this when trying to useupdate, but the differences are visible when simply usingget:Both have the same arguments in the spec arg types.