# `Electric.ShapeCache.ShapeCleaner`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.1/packages/sync-service/lib/electric/shape_cache/shape_cleaner.ex#L1)

Removes a shape (consumer, status entry, on-disk data and publication entry) on demand.

# `reason`

```elixir
@type reason() :: {:shutdown, :cleanup} | {:shutdown, :suspend} | term()
```

# `shape_handle`

```elixir
@type shape_handle() :: Electric.shape_handle()
```

# `stack_id`

```elixir
@type stack_id() :: Electric.stack_id()
```

# `activate_mocked_functions_from_test_process`

# `consumer_cleanup_reason`

# `consumer_suspend_reason`

# `handle_writer_termination`

```elixir
@spec handle_writer_termination(stack_id(), shape_handle(), reason()) ::
  :removed | :ok
```

# `remove_shape`

```elixir
@spec remove_shape(stack_id(), shape_handle(), term()) :: :ok | {:error, term()}
```

# `remove_shape_async`

```elixir
@spec remove_shape_async(stack_id(), shape_handle()) :: :ok
```

# `remove_shape_storage_async`

```elixir
@spec remove_shape_storage_async(stack_id(), [shape_handle()]) :: :ok
```

# `remove_shapes`

```elixir
@spec remove_shapes(stack_id(), [shape_handle()], term()) :: :ok | {:error, term()}
```

# `remove_shapes_async`

```elixir
@spec remove_shapes_async(stack_id(), [shape_handle()]) :: :ok
```

# `remove_shapes_for_relations`

```elixir
@spec remove_shapes_for_relations([Electric.oid_relation()], stack_id(), term()) ::
  :ok
```

---

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