You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
354 B

2 months ago
  1. package agent_client
  2. import (
  3. "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
  4. )
  5. func (a *SubscribeSession) SubscribeMessageRecord(
  6. onEachMessageFn func(key []byte, record *schema_pb.RecordValue),
  7. onCompletionFn func()) error {
  8. for {
  9. resp, err := a.stream.Recv()
  10. if err != nil {
  11. return err
  12. }
  13. onEachMessageFn(resp.Key, resp.Value)
  14. }
  15. }