# BatchScope

# BatchScope


```
@HomeExperimentalApi
interface BatchScope
```

<br />

*** ** * ** ***

The scope for the lifecycle of a batch. Can be used to add new commands to the batch. Batches are single use, not thread-safe, and will throw an exception if attempted to be used outside of their lifecycle.

## Summary

| ### Public functions |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/DeferredResponse<T>` | `<T : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?> https://developers.home.google.com/reference/kotlin/com/google/home/BatchScope#add(com.google.home.Batchable)(batchable: https://developers.home.google.com/reference/kotlin/com/google/home/Batchable<T>)` Adds a new command to the batch. |

## Public functions

### add

```
fun <T : Any?> add(batchable: Batchable<T>): DeferredResponse<T>
```

Adds a new command to the batch.

| Parameters |
|---|---|
| `batchable: https://developers.home.google.com/reference/kotlin/com/google/home/Batchable<T>` | the command to add to the batch. |

| Returns |
|---|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/DeferredResponse<T>` | a response holder which will be populated after the batch completes. |