# `Electric.AsyncDeleter`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.2/packages/sync-service/lib/electric/async_deleter.ex#L1)

A service that batches file/directory deletions by first moving them into a
per-stack trash directory and then, after a configurable interval, removing
the trash directory contents in one `rm -rf` operation.

This reduces filesystem churn when many deletes happen in quick succession
(e.g. cache eviction) and avoids blocking callers: `delete/1` returns after a
quick `File.rename/2` into the trash directory.

Configuration:

  * `:cleanup_interval_ms` - interval in milliseconds after the
     first queued delete before the batch is removed. Defaults to 10000 ms.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `delete`

```elixir
@spec delete(Electric.stack_id(), Path.t()) :: :ok | {:error, term()}
```

Deletes the given directory by first renaming it into the stack's trash directory
then asynchronously removing the trash entry using rm -rf.

# `name`

# `start_link`

# `trash_dir`

# `trash_dir!`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
