From 99556f9cfc2df561dcf7d91c147a129449635224 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 12 Nov 2018 09:25:56 +0900 Subject: server: change monitor API design https://github.com/osrg/gobgp/issues/1763#issuecomment-437594975 Follow Chris's proposal; consistent with the rest of the APIs. Signed-off-by: FUJITA Tomonori --- docs/sources/lib.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/sources/lib.md b/docs/sources/lib.md index c76133f9..ba481797 100644 --- a/docs/sources/lib.md +++ b/docs/sources/lib.md @@ -39,15 +39,8 @@ func main() { } // monitor the change of the peer state - if pm, err := s.NewPeerMonitor(&api.MonitorPeerRequest{}); err != nil { + if err := s.MonitorPeer(context.Background(), &api.MonitorPeerRequest{}, func(p *api.Peer){log.Info(p)}); err != nil { log.Fatal(err) - } else { - defer pm.Close() - go func() { - for v := range pm.Inbox { - log.Info(v) - } - }() } // neighbor configuration -- cgit v1.2.3