google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
68 stars 21 forks source link

Support Async Reads/Writes #84

Open reventlov opened 1 year ago

reventlov commented 1 year ago

C++ Emboss views are backed by a backing storage, which is already a template parameter, so non-RAM backing storage can be supported. (This is not currently documented, but the feature is probably complete. The MakeFooView() methods create views using the emboss::ContiguousBuffer backing storage type, which ultimately uses RAM.)

However, view types currently assume that all reads/writes are low-latency (or that it is safe to block the current thread indefinitely), and do not provide any methods for asynchronous reads or stores. For high-latency backing storage (e.g., a hardware register file accessed through SPY or MODBUS or similar), it would be useful to return a promise or a future that will eventually fulfill the read or write, and provide a notification when it is done.