Skip to content

feat: add all ets/dets functions and ability for ets to rehydrate#33

Open
MikaAK wants to merge 3 commits intomainfrom
ets-rehydration
Open

feat: add all ets/dets functions and ability for ets to rehydrate#33
MikaAK wants to merge 3 commits intomainfrom
ets-rehydration

Conversation

@MikaAK
Copy link
Owner

@MikaAK MikaAK commented Jan 30, 2026

No description provided.

@MikaAK MikaAK changed the title feat: add ability for ets to rehydrate feat: add all ets/dets functions and ability for ets to rehydrate Jan 31, 2026
@MikaAK MikaAK force-pushed the ets-rehydration branch 5 times, most recently from f00dcc0 to 53b450a Compare February 2, 2026 07:38
Copy link
Contributor

@CorneliaKelinske CorneliaKelinske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name field missing?
Mentioned in the implementation_plan.md:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments