Skip to content
Commit a85c69d3 authored by Gilbert Chen's avatar Gilbert Chen Committed by Thu Nguyen
Browse files

requester: Add coroutine API



Added coroutine API to Handler using stdexec to help send and receive
messages in one function call.

For example, to get all PDRs from terminus needs multiple getPDR
commands.  Except first getPDR commands, the following getPDR command
request data(e.g.  dataTransferHandle) needs the previous getPDR command
response data(e.g.  nextDataTransferHandle). By using C++ co_await, the
code to get all PDRs can straightforward be implemented by a while loop.

Pseudo code example:
    do
    {
        auto rc = co_await getPDR(dataTransferHndl, ...);

        // update dataTransferHndl for next getPDR command
        dataTransferHndl = nextDataTransferHndl;

    } while(...);

Signed-off-by: Gilbert Chen's avatarGilbert Chen <gilbert.chen@arm.com>
Signed-off-by: default avatarKhang Nguyen <khangng@amperecomputing.com>
Signed-off-by: default avatarThu Nguyen <thu@os.amperecomputing.com>
Change-Id: I7b47d15ac15f6ae661ec94dca6a281844b939a44
parent 087a751f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment