Consider this code (introduced via this PR: #2029)
|
let _ = tokio::task::block_in_place(move || { |
|
let rt = tokio::runtime::Builder::new_current_thread() |
|
.enable_all() |
|
.build() |
|
.unwrap(); |
|
rt.block_on(async { |
|
// we will ignore if any errors occurred during the bootstrapping the db, |
|
// because the client could be offline when trying to connect. |
|
let _ = db.bootstrap_db().await; |
|
}) |
|
}); |
If libsql library is used in a single threaded environment, then it fails with following error:
can call blocking only when running on the multi-threaded runtime
This is happening due to incorrect use of block_in_place which should be used only in multiple threaded environments.
Consider this code (introduced via this PR: #2029)
libsql/libsql/src/database.rs
Lines 685 to 695 in 10f5dd8
If libsql library is used in a single threaded environment, then it fails with following error:
This is happening due to incorrect use of
block_in_placewhich should be used only in multiple threaded environments.