{"id":15063577,"url":"https://github.com/dominicletz/mutable_map","last_synced_at":"2025-04-10T11:11:59.605Z","repository":{"id":256398292,"uuid":"855206380","full_name":"dominicletz/mutable_map","owner":"dominicletz","description":"Elixir Mutable map using an ETS table for backing and auto garbage collecting ","archived":false,"fork":false,"pushed_at":"2025-01-27T17:47:12.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:04:08.595Z","etag":null,"topics":["elixir"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/mutable_map","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dominicletz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-10T13:50:32.000Z","updated_at":"2025-01-27T17:47:16.000Z","dependencies_parsed_at":"2024-09-10T14:19:25.525Z","dependency_job_id":"f632d61e-10c5-4d2f-8025-1d835890c90d","html_url":"https://github.com/dominicletz/mutable_map","commit_stats":null,"previous_names":["dominicletz/mutable_map"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicletz%2Fmutable_map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicletz%2Fmutable_map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicletz%2Fmutable_map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominicletz%2Fmutable_map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominicletz","download_url":"https://codeload.github.com/dominicletz/mutable_map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208563,"owners_count":21065202,"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"],"created_at":"2024-09-25T00:04:37.107Z","updated_at":"2025-04-10T11:11:59.587Z","avatar_url":"https://github.com/dominicletz.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MutableMap\n\nLarge, no worries mutable maps for Elixir. These `MutableMap`s can be used as drop-in replacements for `Map`s, but can also be used as a shared, mutable, concurrent data store. \n\nMultiple processes can safely read and write to the same `MutableMap` without the need for locking or other synchronization mechanisms. When no process is using the `MutableMap` anymore, it is automatically garbage collected like normal Elixir Maps.\n\n## Motivation\n\nWhen working with large data sets, Elixir's `Map`s and `Keyword`s can become unwieldy. E.g. when using large maps (200mb+) then sending them between processes becomes really slow (Easily 50ms and more for one `send(pid, large_map)`). On the other hand Erlang `:ets` tables can solve this problem, but their API is unwieldy and they require explicit creation and cleaning up.\n\nInstead `MutableMap`s offer an easy to use, performant and most importantly lazy garbage collected data storage solution.\n\n## Usage\n\n```elixir\n# Create a new MutableMap\nMutableMap.new()\n\n# Create a new MutableMap from a list\nMutableMap.new([{1, 2}, {3, 4}])\n\n# Set and get values\nMutableMap.put(map, 1, 2)\nMutableMap.get(map, 1)\n\n# Delete values\nMutableMap.delete(map, 1)\n\n# Since MutableMaps are mutable they can be explicitly copied to create different instances\n\nmap1 = MutableMap.new()\nmap2 = map1\nMutableMap.put(map1, :a, 1)\nMutableMap.to_list(map1)\n# =\u003e [:a, 1]\nMutableMap.to_list(map2)\n# =\u003e [:a, 1]\nmap3 = MutableMap.new(map1)\nMutableMap.put(map3, :b, 2)\nMutableMap.to_list(map1)\n# =\u003e [:a, 1]\nMutableMap.to_list(map3) |\u003e Enum.sort()\n# =\u003e [:a, 1, :b, 2]\n```\n\n\n## Installation\n\nThe package can be installed by adding `mutable_map` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:mutable_map, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicletz%2Fmutable_map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominicletz%2Fmutable_map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicletz%2Fmutable_map/lists"}