10101-PoC
10101-PoC copied to clipboard
chore: Introduce dedicated runtime
Annotating the function with #[tokio::main]
killed the runtime after the function completes. Thus we had to block the run function indefinitely for the long living threads to keep going.
This change introduces a runtime managed outside of the function scope and thus allows the run
function to return bringing the following advantages.
- We don't block a whole frb worker thread just to run the lightning node, sync tasks, background processor, etc.
- We are using a multi threaded runtime instead of the current thread
- allowing to actually join the background processor without blocking all other tasks.
- making better use of multiple cpu cores.
- We are not creating a new runtime on every async bridge call.