attempt blocking at getchannel failed

This commit is contained in:
ModulatingForce 2024-03-31 14:13:20 -04:00
parent 4719b93ce5
commit 000094e9c4
2 changed files with 13 additions and 0 deletions

View file

@ -51,6 +51,7 @@ impl ExecBodyParams {
}
pub async fn get_channel(&self) -> Option<Channel> {
// pub fn get_channel(&self) -> Option<Channel> {
dbg!("Core > ExecBodyParams > GetChannels START");
dbg!("!! [x] Document - After SUCCESS message was sent to chat");
@ -63,6 +64,14 @@ impl ExecBodyParams {
let curr_act = Arc::clone(&self.curr_act);
let curr_act_lock = curr_act.read().await;
// Note : The below `curr_act.blocking_read()` is not possible. I get the following
// during runtime in this areas
/*
thread 'tokio-runtime-worker' panicked at src\core\bot_actions.rs:66:38:
Cannot block the current thread from within a runtime. This happens because a function attempted to block the current thread while the thread is being used to drive asynchronous tasks.
*/
// let curr_act_lock = curr_act.blocking_read();
dbg!("Core > ExecBodyParams > After Creating ExecBodyParams.current_act.read() Guard ");
dbg!("!! [x] Document - After SUCCESS message was sent to chat");
dbg!(">> BotActionAR - RwLock from botmodules.rs::929:46 - current_readers = 1 ");
@ -105,6 +114,7 @@ impl ExecBodyParams {
// let out = Some(r.read().await.channel.clone());
let guard = r.read().await;
// let guard = r.blocking_read();
dbg!("ISSUE> Never makes it after the read guard");

View file

@ -141,6 +141,7 @@ async fn countdown_chnl_v1(params : ExecBodyParams) {
// let parentmodule = params.get_parent_module().await;
let module = params.get_module().await;
// let channel = params.get_channel().await;
let channel = params.get_channel().await;
let routine_attr = vec![
// RoutineAttr::RunOnce
@ -359,6 +360,7 @@ async fn test3_body(params : ExecBodyParams) {
// let parentmodule = params.get_parent_module().await;
let module = params.get_module().await;
// let channel = params.get_channel().await;
let channel = params.get_channel().await;
let routine_attr = vec![
RoutineAttr::RunOnce
@ -436,6 +438,7 @@ async fn test3_body(params : ExecBodyParams) {
// BotAction::C(_) | BotAction::L(_) => None ,
// } ;
// let chnl = params.get_channel().await;
let chnl = params.get_channel().await;
dbg!("Custom > within Child Custom fn - after GetChannel");
println!("{:?}",chnl);