2014-08-19 11:14:14 +02:00
|
|
|
// Copyright 2014 by Sascha L. Teichmann
|
|
|
|
// Use of this source code is governed by the MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2014-08-19 12:07:57 +02:00
|
|
|
import (
|
2014-08-19 12:23:33 +02:00
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"bitbucket.org/s_l_teichmann/mtredisalize/common"
|
2014-08-19 12:07:57 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var NoMoreBlocksErr = fmt.Errorf("No more blocks.")
|
2014-08-19 11:14:14 +02:00
|
|
|
|
|
|
|
type (
|
|
|
|
Block struct {
|
|
|
|
Coord common.Coord
|
|
|
|
Data []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
BlocKProducer interface {
|
2014-08-19 12:23:33 +02:00
|
|
|
// Returns next block.
|
|
|
|
// error is NoMoreBlocksErr if it run out of blocks.
|
2014-08-19 11:14:14 +02:00
|
|
|
Next() (Block, error)
|
|
|
|
Close() error
|
|
|
|
}
|
|
|
|
|
|
|
|
BlockConsumer interface {
|
|
|
|
Consume(Block)
|
|
|
|
Close() error
|
|
|
|
}
|
|
|
|
)
|