...
1
2
3
4
5
6
7 package driver
8
9 import (
10 "context"
11 "errors"
12 )
13
14
15
16 func (op Operation) ExecuteExhaust(ctx context.Context, conn StreamerConnection) error {
17 if !conn.CurrentlyStreaming() {
18 return errors.New("exhaust read must be done with a connection that is currently streaming")
19 }
20
21 res, err := op.readWireMessage(ctx, conn)
22 if err != nil {
23 return err
24 }
25 if op.ProcessResponseFn != nil {
26
27 info := ResponseInfo{
28 ServerResponse: res,
29 Connection: conn,
30 }
31 if err = op.ProcessResponseFn(info); err != nil {
32 return err
33 }
34 }
35
36 return nil
37 }
38
View as plain text