FDio / govpp

Go toolset for the VPP.
Apache License 2.0
193 stars 82 forks source link

Add support of watching events to Connection #80

Closed ondrej-fabry closed 1 year ago

ondrej-fabry commented 1 year ago

This PR adds support for event watching to Connection (Stream API). This initial draft proposal was done by @edwarnicke in #42. However, this PR does not change the generated RPC code in any way for now.

Quick look at the new API:

type Connection {
    // ...
    WatchEvent(ctx context.Context, event Message) (Watcher, error)
}

type Watcher interface {
    Events() <-chan Message
    Close()
}

See the stream-client example for usage details.