Skip to content

Commit 6a3db1c

Browse files
committed
Document runtime assumptions
Describe the Tokio runtime expectations for LDK Node callers so async API users know when runtime handles are reused and why runtime worker threads must remain available for node progress. Co-Authored-By: HAL 9000
1 parent dd68c11 commit 6a3db1c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
//! Lightning node with an integrated on-chain wallet. While minimalism is at its core, LDK Node
1717
//! aims to be sufficiently modular and configurable to be useful for a variety of use cases.
1818
//!
19+
//! ## Runtime Assumptions
20+
//!
21+
//! LDK Node's Rust API is async and expects its futures to be polled by a Tokio runtime. When a
22+
//! node is built from within an existing Tokio context, LDK Node reuses that runtime handle for
23+
//! internally spawned work; otherwise it creates an owned multi-thread Tokio runtime for its
24+
//! background tasks. Callers should keep the runtime threads available to drive network, timer, and
25+
//! persistence futures while node operations are in progress. Long synchronous work should run
26+
//! outside those worker threads, or on a dedicated blocking pool, so it does not prevent LDK Node's
27+
//! I/O and storage tasks from making progress.
28+
//!
1929
//! ## Getting Started
2030
//!
2131
//! The primary abstraction of the library is the [`Node`], which can be retrieved by setting up

0 commit comments

Comments
 (0)