|
As it stands today, both ingress and egress code paths use the same Session abstraction to implement their respective sides of sending or receiving commands. To accommodate this, the Session API provides 6 functions to enable sync and async interactions:
- StatusWith<Message> sourceMessage()
- Future<Message> asyncSourceMessage(const BatonHandle& handle)
- Status waitForData()
- Future<void> asyncWaitForData()
- Status sinkMessage(Message message)
- Future<void> asyncSinkMessage(Message message, const BatonHandle& handle)
Follow the pattern established by the refactor of the SessionWorkflow (formerly ServiceStateMachine) and use Future to provide an async-agnostic API to callers instead:
- Future<Message> receiveMessage(PollingCoordinator& pc)
- Future<void> sendMessage(PollingCoordinator& pc, const Message& msg)
- Future<void> whenDataReady()
|