{"id":15010097,"url":"https://github.com/am-kantox/easy_ets","last_synced_at":"2025-12-11T23:43:43.032Z","repository":{"id":57492420,"uuid":"183574688","full_name":"am-kantox/easy_ets","owner":"am-kantox","description":"The very simple ETS wrapper simplifying cross-process ETS handling (like `Agent`, but `:ets`).","archived":false,"fork":false,"pushed_at":"2019-06-07T05:11:54.000Z","size":23,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T03:35:25.481Z","etag":null,"topics":["elixir","elixir-lang","ets"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/am-kantox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-26T06:55:03.000Z","updated_at":"2023-12-03T05:11:30.000Z","dependencies_parsed_at":"2022-09-01T21:03:10.852Z","dependency_job_id":null,"html_url":"https://github.com/am-kantox/easy_ets","commit_stats":null,"previous_names":["am-kantox/nimble_ets"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Feasy_ets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Feasy_ets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Feasy_ets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/am-kantox%2Feasy_ets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/am-kantox","download_url":"https://codeload.github.com/am-kantox/easy_ets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589830,"owners_count":20963022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-lang","ets"],"created_at":"2024-09-24T19:30:09.962Z","updated_at":"2025-12-11T23:43:37.978Z","avatar_url":"https://github.com/am-kantox.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![CircleCI](https://circleci.com/gh/am-kantox/easy_ets.svg?style=svg)](https://circleci.com/gh/am-kantox/easy_ets)    EasyETS\n\nThe very simple [`:ets`](http://erlang.org/doc/man/ets.html) wrapper simplifying\ncross-process [`:ets`](http://erlang.org/doc/man/ets.html) handling\n(like [`Agent`](https://hexdocs.pm/elixir/master/Agent.html),\nbut [`:ets`](http://erlang.org/doc/man/ets.html)).\n\n## Intro\n\n`EasyETS` is a very thin simple ETS wrapper, simplifying the trivial usage of ETS\nas key-value store. It is not intended to replicate `:ets` module functionality\nby any mean. It might be used as a drop-in to avoid process-based `Agent` as\nkey-value store.\n\nIt exposes _only_ `CRUD` functionality of _ETS_, alongside with `Access` behaviour.\n\nBuilt on top of `:ets`, it’s not distributed. Tables created are sets; `public`\nand `named` by default. This might be changed by passing `{table_name, options}`\ntuple instead of just table name to the initializer (see below.)\n\n## Usage\n\nThere are two ways `EasyETS` might be used: as a standalone module,\nor as a module extension.\n\n### Standalone usage\n\n```elixir\niex\u003e EasyETS.new(MyApp.MyModuleToBeGenerated)\n\niex\u003e MyApp.MyModuleToBeGenerated.ets_put(:foo, 42)\n%MyApp.MyModuleToBeGenerated{table: MyApp.MyModuleToBeGenerated}\n\niex\u003e MyApp.MyModuleToBeGenerated.ets_get(:foo, 42)\n42\n\niex\u003e term = %{data: MyApp.MyModuleToBeGenerated.ets_put(:value, 42)}\niex\u003e update_in(term, [:data, :value], fn _ -\u003e \"👍\" end)\niex\u003e get_in(term, [:data, :value])\n\"👍\"\n```\n\nThe table is actually managed by the `EasyETS` application,\nso it won’t be destroyed if the process called `EasyETS.new/1` exits.\n\n### Module\n\n```elixir\ndefmodule MyApp.MyModuleBackedByTable do\n  use EasyETS\n\n  ...\nend\n```\n\nOne might override `EasyETS.ets_table_name/0` in the module to change\nthe name of the table.\n\n## Interface exported\n\n`EasyETS` exports the simplest possible interface for `CRUD` on purpose.\nWhether one needs more sophisticated `:ets` operations, it’s still possible\nthrough `%MyApp.MyModuleBackedByTable{}.table` (yes, it’s a struct underneath.)\nThe latter holds the reference to the respective `:ets` table.\n\n```elixir\n@doc \"Updates the value in the table under the key passed\"\n@spec ets_put(key :: term(), value :: term()) :: EasyETS.t()\n\n@doc \"Retrieves the value from the table stored under the key passed\"\n@spec ets_get(key :: term(), default :: any()) :: term()\n\n@doc \"Deletes the value from the table stored under the key passed\"\n@spec ets_del(key :: term()) :: EasyETS.t()\n\n@doc \"Returns all the values from the table\"\n@spec ets_all() :: list()\n```\n\n## `Access` behaviour\n\nModules produced / updated by `EasyETS` do support `Access` behaviour.\n\n## `Env́io` support\n\nModules produced / updated by `EasyETS` do send broadcast messages\non both `:update` and `:delete` actions. See [`Env́io`](https://hexdocs.pm/envio/envio.html#creating-a-subscriber) documentation on how to subscribe to them.\n\nEach message is sent to two channels: `:all` (all the updates managed by `NimbleCSV`)\nand the channel with the name equal to the name of the table updated.\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:easy_ets, \"~\u003e 0.1\"}\n  ]\nend\n```\n\n## [Documentation](https://hexdocs.pm/easy_ets).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-kantox%2Feasy_ets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fam-kantox%2Feasy_ets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-kantox%2Feasy_ets/lists"}