> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebind.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Handles

> The objects rb calls return to stop, pause or inspect what they started.

Many `rb` calls return a handle: an object that controls what the call started,
such as a task, a timer, a macro, a bind or a server. Keep the handle when the
script needs to stop, pause or check on that work later, and call its methods
with `:`. Each handle except `EventHandle`, which `rb.on` returns with `stop`
alone, also answers to its [v1 names](https://docs.rebind.gg/reference/v1-names.md#handle-methods).

**Needs:** a coroutine for a `MacroHandle`'s `wait`, so call it inside `rb.run`
or `rb.async` (see [Where code runs](https://docs.rebind.gg/reference/sdk/globals.md#where-code-runs)).

| Handle | Returned by | Members |
| - | - | - |
| `TaskHandle` | `rb.run`, `rb.after` | `stop()`, `is_running()` |
| `TimerHandle` | `rb.timer.after`, `rb.timer.every` | `stop()`, `pause()`, `resume()`, `is_running()` |
| `MacroHandle` | `rb.macro.play` | `stop()`, `pause()`, `resume()`, `is_playing()`, `get_progress()` (0 to 1), `wait()` |
| `BindHandle` | `rb.bind`, `rb.bind.toggle`, `rb.bind.remap` | `stop()`, `disable()`, `enable()`, `enabled` |
| `EventHandle` | `rb.on` | `stop()` |
| `ServerHandle` | `rb.net.listen` | `port`, `stop()` |
| `WsServerHandle` | `rb.net.ws_listen` | `port`, `broadcast(text)`, `broadcast_binary(bytes)`, `client_count()`, `stop()` |
| `WsClient` | `ws_listen` handlers | `id`, `send(text)`, `send_binary(bytes)`, `close()` |
| `WsConnectHandle` | `rb.net.ws_connect` | `send(text)`, `send_binary(bytes)`, `close()` |
| `UdpHandle` | `rb.net.udp_listen` | `port`, `send_to(ip, port, bytes)`, `stop()` |
| `PipeHandle` | `rb.pipe.open` | `name`, `size`, `capacity`, `read()`, `write(data)`, `close()` |
| `SoundHandle` | `rb.audio.play` | `stop()`, `pause()`, `resume()`, `is_playing()`, `set_volume(vol)`, `get_volume()` |

`is_running` is `false` once a one-shot timer fired or a task ended, and while a
timer is paused. A disabled bind still intercepts its key. `wait` returns when
the macro stops playing.


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