[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Task](https://evolu.dev/docs/api-reference/common/Task) › concurrently

## Call Signature

```ts
function concurrently<T, E, D>(
  concurrency: Concurrency,
  task: Task<T, E, D>,
): Task<T, E, D>;
```

Defined in: [packages/common/src/Task.ts:1609](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Task.ts#L1609)

Runs tasks concurrently instead of sequentially.

Sets the [Concurrency](https://evolu.dev/docs/api-reference/common/Task/type-aliases/Concurrency) level for a [Task](https://evolu.dev/docs/api-reference/common/Task/type-aliases/Task), which helpers like
[all](https://evolu.dev/docs/api-reference/common/Task/functions/all), [map](https://evolu.dev/docs/api-reference/common/Task/functions/map), etc. use to control how many tasks run at once.

By default, tasks run sequentially (one at a time) to encourage thinking
about concurrency explicitly.

For tuple-based calls like `all([taskA, taskB, taskC])` with a known small
number of tasks, omit the limit (runs unlimited). For arrays of unknown
length, always specify a limit.

Concurrency is inherited by child tasks and can be overridden at any level.
Composition helpers should respect inherited concurrency — they should not
override it with a fixed number unless semantically required (like
[race](https://evolu.dev/docs/api-reference/common/Task/functions/race)). Helpers with a recommended concurrency should export it for use
with `concurrently`.

### Example

```ts
// Unlimited (omit the limit)
run(concurrently(all([fetchA, fetchB, fetchC])));

// Limited — at most 5 tasks run at a time
run(concurrently(5, all(tasks)));
run(concurrently(5, map(userIds, fetchUser)));

// Inherited — inner all() uses parent's limit
const pipeline = concurrently(5, async (run) => {
  const users = await run(map(userIds, fetchUser)); // uses 5
  if (!users.ok) return users;
  return run(map(users.value, enrichUser)); // also uses 5
});
```

## Call Signature

```ts
function concurrently<T, E, D>(task: Task<T, E, D>): Task<T, E, D>;
```

Defined in: [packages/common/src/Task.ts:1614](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Task.ts#L1614)

Unlimited.