# Allow external handles to be provided to gpui_tokio \(\#42795\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/158ebdc5803f9f69dfbfddcd216f04e5bc6001d9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 158ebdc5803f9f69dfbfddcd216f04e5bc6001d9

Requested commit: 158ebdc5803f9f69dfbfddcd216f04e5bc6001d9

Commit: 158ebdc5803f9f69dfbfddcd216f04e5bc6001d9

Tree: fccd8867266982b8b5f4ff699f7a7ff8360ef0ea

Author: William Whittaker

Committer: GitHub

## Message

```
Allow external handles to be provided to gpui_tokio (#42795)

This PR allows for a handle to an existing Tokio runtime to be passed to
gpui_tokio's initialization function, which means that Tokio runtimes
created externally can be used.

Mikayla suggested that the function simply take the runtime from
whatever context the initialization function is called from but I think
there could reasonably be situations where that isn't the case and this
shouldn't have a meaningful impact to code complexity. If you want to
use the current context's runtime you can just do
`gpui_tokio::init_from_handle(cx, Handle::current());`.

This doesn't have an impact on the current users of the crate - the
existing `init()` function is functionally unchanged.

Release Notes:

- N/A
```

## Parents

- [f4c3a6c23690e0931fffbdca69a1ecada971d737](https://git.cafe/gitcafe/zed/commit/f4c3a6c23690e0931fffbdca69a1ecada971d737?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/158ebdc5803f9f69dfbfddcd216f04e5bc6001d9?format=markdown)
