Implement stream_events() rpc call #4
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Contributions are welcome
We need to given clients a way to subscribe for driver events, such as adding, deleting, or updating virtual devices. So that if one client (e.g. command-line tool) adds a device, another client (e.g. GUI) will be notified of that.
In
driver_protocol.proto
, we already havestream_logs()
call that sends a stream of log entries from driver to client. Similarly, we can addstream_events()
call, that would send a stream of event entry.Each event entry could contain two fields:
When a client calls
stream_events()
, we first should generateDEVICE_ADDED
event for every device that is already present. That would allow client to monitor devices without race conditions (otherwise, if client gets device list before streaming, it can miss devices that appeared between device list request and streaming request).In addition to RPC call, we need to add a command to CLI tool, say,
roc-vad events
. It should be similar toroc-vad logcat
: connect to driver, callstream_events()
, and print received events to console.Related files:
rpc/driver_protocol.proto
- defines RPC interfacedriver/driver_service.cpp
- implements RPC interface on driver sidedriver/device_manager.cpp
- implements adding/removing/updating devices; we need to add subscribe/unsubscribe feature here and use it from DriverServicetool/cmd_logcat.cpp
- implementsroc-vad logcat
commandSee also documentation in README and HACKING.md.
The text was updated successfully, but these errors were encountered: