Skip to content

Using C++20 coroutines to handle messages in agents #102

Description

@matveigavrilov1

Hello! Have you considered using coroutines to process messages in agents? It would be good solution for waiting messages with saving context.

Something like that

class SomeAgent: public agent_t
{
// ...

coro_type sendRequestWaitResponse()
{
    so_5::send<Request>(someMbox);
    auto response = co_await so_5::receive<Response>(someMbox);
    // handle response
}

//...
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions