Zhen Ye 5669016af0
enhance: erase the rpc level when wal is located at same node (#38858)
issue: #38399

- Make the wal scanner interface same with streaming scanner.
- Use wal if the wal is located at current node.
- Otherwise fallback the old logic.

Signed-off-by: chyezh <chyezh@outlook.com>
2025-02-05 22:25:10 +08:00

19 lines
594 B
Go

package consumer
var _ Consumer = (*consumerImpl)(nil)
// Consumer is the interface that wraps the basic consume method on grpc stream.
// Consumer is work on a single stream on grpc,
// so Consumer cannot recover from failure because of the stream is broken.
type Consumer interface {
// Error returns the error of scanner failed.
// Will block until scanner is closed or Chan is dry out.
Error() error
// Done returns a channel which will be closed when scanner is finished or closed.
Done() <-chan struct{}
// Close the consumer, release the underlying resources.
Close() error
}