> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# CrashableBackend

> Interface exported by @botmesh/core/testing.

Defined in: [testing/crash.ts:43](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L43)

A [DurabilityBackend](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend.md) that can be crashed (see [crashable](https://botmesh.afaya.com.co/api/core/testing/functions/crashable.md)).

## Extends

* [`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend)

## Properties

### inbox

```ts theme={null}
readonly inbox: InboxJournal;
```

Defined in: [durability/types.ts:321](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/types.ts#L321)

#### Inherited from

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`inbox`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#inbox)

***

### outbox

```ts theme={null}
readonly outbox: OutboxJournal;
```

Defined in: [durability/types.ts:322](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/types.ts#L322)

#### Inherited from

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`outbox`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#outbox)

***

### exclusive?

```ts theme={null}
readonly exclusive?: boolean;
```

Defined in: [durability/types.ts:327](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/types.ts#L327)

`true` when only one process can use the backend at a time (memory, file). A restarted
process then knows every lease of its `instanceId` is its own dead incarnation's.

#### Inherited from

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`exclusive`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#exclusive)

***

### inner

```ts theme={null}
readonly inner: DurabilityBackend;
```

Defined in: [testing/crash.ts:45](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L45)

The wrapped backend (what survives the crash).

***

### crashed

```ts theme={null}
readonly crashed: boolean;
```

Defined in: [testing/crash.ts:47](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L47)

True once crashed.

***

### whenCrashed

```ts theme={null}
readonly whenCrashed: Promise<void>;
```

Defined in: [testing/crash.ts:49](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L49)

Resolves when the crash happens.

***

### calls

```ts theme={null}
readonly calls: ReadonlyMap<JournalOp, number>;
```

Defined in: [testing/crash.ts:57](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L57)

Number of calls of each operation so far.

## Methods

### start()?

```ts theme={null}
start?(): Promise<void>;
```

Defined in: [durability/types.ts:336](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/types.ts#L336)

Called by `bot.start()` before anything is replayed.

#### Returns

`Promise`\<`void`>

#### Inherited from

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`start`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#start)

***

### stop()?

```ts theme={null}
stop?(): Promise<void>;
```

Defined in: [durability/types.ts:338](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/types.ts#L338)

Called by `bot.stop()` after the provider stopped.

#### Returns

`Promise`\<`void`>

#### Inherited from

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`stop`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#stop)

***

### crash()

```ts theme={null}
crash(): void;
```

Defined in: [testing/crash.ts:51](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L51)

Crash now: every later call hangs forever.

#### Returns

`void`

***

### crashBefore()

```ts theme={null}
crashBefore(op, nth?): void;
```

Defined in: [testing/crash.ts:53](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L53)

Crash when the `nth` (default 1st) call of `op` starts, before it reaches the backend.

#### Parameters

| Parameter | Type |
| - | - |
| `op` | [`JournalOp`](https://botmesh.afaya.com.co/api/core/testing/type-aliases/JournalOp) |
| `nth?` | `number` |

#### Returns

`void`

***

### crashAfter()

```ts theme={null}
crashAfter(op, nth?): void;
```

Defined in: [testing/crash.ts:55](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L55)

Crash when the `nth` (default 1st) call of `op` committed, before its caller sees the result.

#### Parameters

| Parameter | Type |
| - | - |
| `op` | [`JournalOp`](https://botmesh.afaya.com.co/api/core/testing/type-aliases/JournalOp) |
| `nth?` | `number` |

#### Returns

`void`

***

### scope()?

```ts theme={null}
scope?(name): CrashableBackend;
```

Defined in: [testing/crash.ts:59](https://github.com/andresayac/botmesh/blob/main/packages/core/src/testing/crash.ts#L59)

A crashable view of `inner.scope(name)` sharing this wrapper's crash state and counters.

#### Parameters

| Parameter | Type |
| - | - |
| `name` | `string` |

#### Returns

`CrashableBackend`

#### Overrides

[`DurabilityBackend`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend).[`scope`](https://botmesh.afaya.com.co/api/core/interfaces/DurabilityBackend#scope)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.