Skip to content

Introduce Runtime object allowng to detect outer runtime context - #543

Merged
tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2025-05-allow-to-use-runtime-handle
Aug 18, 2025
Merged

tnull merged 1 commit into
lightningdevkit:mainfrom
tnull:2025-05-allow-to-use-runtime-handle

Conversation

@tnull

@tnull tnull commented May 19, 2025 •

Copy link
Copy Markdown
Collaborator

Closes #491

Instead of holding an Arc<RwLock<Option<Arc<tokio::runtime::Runtime>>>
and dealing with stuff like tokio::task::block_in_place at all
callsites, we introduce a Runtime object that takes care of the state
transitions, and allows to detect and reuse an outer runtime context.

We also adjust the with_runtime API to take a tokio::runtime::Handle
rather than an Arc<Runtime>.

We then also go ahead an reuse said Runtime object for VssStore.

(cc @andrei-21)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

weekly goal Someone wants to land this this week

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Auto-detect existing tokio runtime?

5 participants