feat: add all ets/dets functions and ability for ets to rehydrate#33
feat: add all ets/dets functions and ability for ets to rehydrate#33
Conversation
f00dcc0 to
53b450a
Compare
53b450a to
9a6f411
Compare
CorneliaKelinske
left a comment
There was a problem hiding this comment.
Do you want to keep the implementation pan committed?
| :ets.new(table_name, ets_opts) | ||
| end | ||
|
|
||
| defp setup_exit_signal_handlers(table_name, rehydration_path) do |
There was a problem hiding this comment.
Just double-checking: we're not handling graceful supervisor shutdowns. And isn't there a risk that by the time the signal arrives the ETS table (which is running inside a Task) is already gone?
There was a problem hiding this comment.
Not quite because the ets table is alive as long as the owner process in this case this process is alive. So it should trap the exit, and sigterm is a graceful exit!
| end | ||
| end | ||
|
|
||
| def hash_set_many(cache_name, keys_fields_values, ttl, _opts) do |
There was a problem hiding this comment.
Test needs to be updated to new return value here
|
|
||
| defp match_element?(_obj, :_), do: true | ||
| defp match_element?(_obj, pattern) when is_atom(pattern) and pattern !== :_, do: binding?(pattern) or false | ||
| defp match_element?(obj, pattern), do: obj === pattern |
There was a problem hiding this comment.
What about literal atoms? I think they would wrongly be handled by function clause 2?
Similar issue for transform_result
| end) | ||
| end | ||
|
|
||
| defp apply_single_match_spec(object, {pattern, _guards, result_spec}) do |
There was a problem hiding this comment.
Curious, why are guards ignored? wouldn't that lead to unexpected returns? Might be hard to implement and not worth it though
| type: :set, | ||
| named_table: true, | ||
| keypos: 1, | ||
| protection: :public |
There was a problem hiding this comment.
name field missing?
Mentioned in the implementation_plan.md:15
No description provided.