(backend *pgproto3.Backend)
| 108 | type waitForCloseMessageStep struct{} |
| 109 | |
| 110 | func (e *waitForCloseMessageStep) Step(backend *pgproto3.Backend) error { |
| 111 | for { |
| 112 | msg, err := backend.Receive() |
| 113 | if err == io.EOF { |
| 114 | return nil |
| 115 | } else if err != nil { |
| 116 | return err |
| 117 | } |
| 118 | |
| 119 | if _, ok := msg.(*pgproto3.Terminate); ok { |
| 120 | return nil |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func WaitForClose() Step { |
| 126 | return &waitForCloseMessageStep{} |