README.md

# Concurrent

Lightweight Enum with concurrency.

## Contents

* [Usage](#usage)
* [Installation](#installation)
* [Testing](#testing)

## Usage

```elixir
iex> Concurrent.each([1, 2, 3], fn i -> Process.sleep(500) end)
:ok
```

To set a timeout for each element function execution:

```elixir
iex> Concurrent.map([1, 2, 3], &(&1 * &1), timeout: 500)
[1, 4, 9]
```

To limit the number of concurrent executions:

```elixir
iex> Concurrent.map([1, 2, 3], &(&1 * &1), batch_size: 2)
[1, 4, 9]
```

## Installation

The package can be installed by adding `concurrent` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:concurrent, "~> 0.3.0"}
  ]
end
```

## Testing

```
mix deps.get
mix test
```