Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FetchPolicies = []FetchPolicy{FetchSequential, FetchRandom, FetchBalance}
)
Functions ¶
This section is empty.
Types ¶
type Barrel ¶
type Barrel struct { MouldId string `json:"mould_id"` BatchId string `json:"batch_id"` Time int64 `json:"time"` D []byte `json:"d"` }
func (Barrel) BarrelBatch ¶
type Bundle ¶
type Bundle interface { // Enqueue data with batchId Enqueue(b Barrel) // Fetch data from the queue. Fetch() (b Barrel, found bool) // Mark data as completed Complete(b Barrel) // Size of uncompleted tasks. Size() (total int) // Size of the InProgress queue SizeInProgress() int // Close this bundle. Close() // Preserve this bundle. Preserve() (session Session, err error) }
Bundle interface will not return error. If there any error happens, the impl. should recover from the error themself or raise panic() to tell critical issue to the caller.
func NewSimple ¶
func NewSimple(logger esl.Logger, policy FetchPolicy, progress eq_progress.Progress, factory eq_pipe.Factory) Bundle
func RestoreSimple ¶
func RestoreSimple(logger esl.Logger, policy FetchPolicy, progress eq_progress.Progress, factory eq_pipe.Factory, session Session) (b Bundle, err error)
type FetchPolicy ¶
type FetchPolicy string
const ( FetchSequential FetchPolicy = "sequential" FetchRandom FetchPolicy = "random" FetchBalance FetchPolicy = "balance" )
type OnCompleteHandler ¶
Click to show internal directories.
Click to hide internal directories.