{"id":16317700,"url":"https://github.com/zfletch/p_enum","last_synced_at":"2025-05-13T16:33:02.052Z","repository":{"id":57530921,"uuid":"121884741","full_name":"zfletch/p_enum","owner":"zfletch","description":"Parallel Enum functions in Elixir","archived":false,"fork":false,"pushed_at":"2018-02-17T19:43:47.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T20:21:03.145Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zfletch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-17T19:18:27.000Z","updated_at":"2018-02-17T19:18:46.000Z","dependencies_parsed_at":"2022-09-05T10:01:15.719Z","dependency_job_id":null,"html_url":"https://github.com/zfletch/p_enum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fp_enum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fp_enum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fp_enum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfletch%2Fp_enum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zfletch","download_url":"https://codeload.github.com/zfletch/p_enum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981934,"owners_count":21994361,"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":[],"created_at":"2024-10-10T22:09:03.382Z","updated_at":"2025-05-13T16:33:02.023Z","avatar_url":"https://github.com/zfletch.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEnum\n\nParallel `Enum`. This library provides a set of functions similar to the\nones in the [Enum](https://hexdocs.pm/elixir/Enum.html) module except that\nthe function argument is executed on each element in parallel.\n\nThe behavior of each of the `PEnum` functions should be the same as the `Enum`\nvarieties, except that order of execution is not guaranteed.\n\nExcept where otherwise noted, the function names are identical to the ones in\n`Enum` but with a `p` in front. For example, `PEnum.pmap` is a parallel version of\n`Enum.map`.\n\n## Installation\n\nIt is [available in Hex](https://hex.pm/packages/p_enum) and package can be installed\nby adding `p_enum` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:p_enum, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be found at [https://hexdocs.pm/p_enum](https://hexdocs.pm/p_enum).\n\n### Examples\n\n```elixir\nexpensive_function = fn n -\u003e Enum.reduce(1..n, \u0026Kernel.*/2) end\n\n[30000, 40000, 50000] |\u003e PEnum.pmap(expensive_function)\n```\n\n```elixir\ndef numbers_less_than_five(enumerable) do\n  enumerable\n  |\u003e PEnum.pfilter(fn n -\u003e\n    time = DateTime.utc_now()\n    :timer.sleep(n * 1000)\n    DateTime.diff(DateTime.utc_now(), time) \u003c 5\n  end)\nend\n```\n\n### Functions\n\n* `pchunk_by/2`\n* `pcount/2`\n* `pdedup_by/2`\n* `peach/2`\n* `pfilter/2`\n* `pgroup_by/2`\n* `pgroup_by/3`\n* `group_byp/2`\n* `group_byp/3`\n* `pgroup_byp/2`\n* `pgroup_byp/3`\n* `pflat_map/2`\n* `pinto/3`\n* `pmap/2`\n* `pmap_every/3`\n* `pmap_join/2`\n* `pmap_join/3`\n* `pmax_by/2`\n* `pmax_by/3`\n* `pmin_by/2`\n* `pmin_by/3`\n* `pmin_max_by/2`\n* `pmin_max_by/3`\n* `preject/2`\n* `puniq_by/2`\n\n#### The group\\_by family of functions\n\nThe `Enum.group_by` function takes two functions as arguments:\na `key_fun` and a `value_fun`. Since someone may want to run either\nor both in parallel, there are three `PEnum` functions corresponding\nto `Enum.group_by`:\n\n* `pgroup_by` - runs only `key_fun` in parallel\n* `group_byp` - runs only `value_fun` in parallel\n* `pgroup_byp` - runs both `key_fun` and `value_fun` in parallel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfletch%2Fp_enum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzfletch%2Fp_enum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfletch%2Fp_enum/lists"}