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 <gilbert.chen@arm.com> Signed-off-by:
Khang Nguyen <khangng@amperecomputing.com> Signed-off-by:
Thu Nguyen <thu@os.amperecomputing.com> Change-Id: I7b47d15ac15f6ae661ec94dca6a281844b939a44
Loading
Please register or sign in to comment