generic

package
v0.0.0-...-5dcd16a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Helper to implement GroupHead sequences.

Derived from Blue, with the Cassandra stuff scooped out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkAllocator

type BulkAllocator interface {
	AllocIds(group []byte, buf []uint64) ([]uint64, error)
	RevertIds(group []byte, buf []uint64) error
}

type Frontend

type Frontend struct {
	R Requester
}

func (*Frontend) GroupHeadInsert

func (f *Frontend) GroupHeadInsert(groups [][]byte, buf []int64) (nums []int64, err error)

func (*Frontend) GroupHeadRevert

func (f *Frontend) GroupHeadRevert(groups [][]byte, nums []int64) (err error)

type Request

type Request struct {
	IsRollback bool
	Group      []byte
	Number     uint64
	Err        error
	WG         sync.WaitGroup
}

type Requester

type Requester interface {
	Offer(p *Request) (err error)
}

func NewRequester

func NewRequester(s BulkAllocator, requestsPerGroup int) Requester

func NewRequesterSimple

func NewRequesterSimple(s BulkAllocator) Requester

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL