client: support sending events asynchronously

Makes blocking and waiting for success/error optional, also allows
concurrent use of the rest of the client while events are sent.
This commit is contained in:
Michael Marineau 2017-06-06 17:03:22 -07:00
parent c42bec118e
commit 03222d488c
2 changed files with 27 additions and 13 deletions

View file

@ -167,7 +167,7 @@ func TestClientEvent(t *testing.T) {
Type: omaha.EventTypeDownloadComplete,
Result: omaha.EventResultSuccess,
}
if err := ac.Event(event); err != nil {
if err := <-ac.Event(event); err != nil {
t.Fatal(err)
}