Open
Description
Hello,
I’m currently implementing an async performer, starting from a synchronous version. In the synchronous setup, I have:
result = sync_perform(mock_dispatcher, main_sequence(logger))
This approach uses a pure logic sequence for managing effects in main_sequence
, which can be found here.
For the async version, I have created a custom async_perform
function to handle asynchronous performers, defined here.
Usage
In the async main, the call looks like this:
result = await async_perform(mock_dispatcher, main_sequence(logger))
Here’s an example of an async performer:
# ...
async def mock_create_request_performer(dispatcher, intent):
logger.debug(f"Mock: Creating request... {intent.payload} with token {token}")
await asyncio.sleep(1)
# ...
return TypeDispatcher({
CreateRequest: mock_create_request_performer,
# ...
Look at my feat/async branch for the whole sample.
Would this be considered the recommended approach for handling async performers, or are there any improvements or best practices that you’d suggest?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels