Skip to content

Commit

Permalink
changed flow invoke async method
Browse files Browse the repository at this point in the history
  • Loading branch information
DinisCruz committed Oct 4, 2024
1 parent 07ecd05 commit 0fab18f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osbot_utils/helpers/flows/Flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from osbot_utils.utils.Misc import random_id, lower
from osbot_utils.utils.Python_Logger import Python_Logger
from osbot_utils.utils.Str import ansis_to_texts
from osbot_utils.utils.Threads import invoke_async
from osbot_utils.utils.Threads import invoke_async, invoke_in_new_event_loop

FLOW__RANDOM_ID__PREFIX = 'flow_id__'
FLOW__RANDOM_NAME__PREFIX = 'flow_name__'
Expand Down Expand Up @@ -88,7 +88,8 @@ def info(self, message):

def invoke_flow_target(self):
if asyncio.iscoroutinefunction(self.flow_target):
self.flow_return_value = invoke_async(self.flow_target(*self.flow_args, **self.flow_kwargs))
#self.flow_return_value = invoke_async(self.flow_target(*self.flow_args, **self.flow_kwargs))
self.flow_return_value = invoke_in_new_event_loop(self.flow_target(*self.flow_args, **self.flow_kwargs))
else:
self.flow_return_value = self.flow_target(*self.flow_args, **self.flow_kwargs)

Expand Down

0 comments on commit 0fab18f

Please sign in to comment.