aggmq

package
v1.1.0-alpha-4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	CmdWaitSlaveSync
	CmdKillMe
)

Variables

View Source
var (
	// ErrSendCmdTimeout returned when the command doesn't get any response after
	// some amount of time
	ErrSendCmdTimeout = errors.New("send command timed out")
)
View Source
var (
	// ErrSlaveSyncTimeout returned when slave syncer doesn't give response
	// until some amount of time
	ErrSlaveSyncTimeout = errors.New("slave sync timed out")
)

Functions

This section is empty.

Types

type AggComm

type AggComm struct {
	// contains filtered or unexported fields
}

AggComm defines communication channels between aggregation producer and consumer/processor

func (*AggComm) Destroy

func (comm *AggComm) Destroy()

Destroy destroys this communication channel. It also means destroying the consumer

func (*AggComm) RecvAgg

func (comm *AggComm) RecvAgg() <-chan AggMqMsg

RecvAgg recv aggregation from this comm object

func (*AggComm) RecvCmd

func (comm *AggComm) RecvCmd() <-chan Command

RecvCmd receive command from this comm object

func (*AggComm) SendAgg

func (comm *AggComm) SendAgg(agg AggMqMsg)

SendAgg send aggregation via this comm object

func (*AggComm) SendCmd

func (comm *AggComm) SendCmd(cmd int, seq uint64) error

SendCmd send command using this comm object

func (*AggComm) SendResp

func (comm *AggComm) SendResp(err error)

SendResp send response using this comm object

type AggMqMsg

type AggMqMsg []byte

AggMqMsg defines message given to the aggregation processor

type AggProcessorConfig

type AggProcessorConfig struct {
	VdiskID  string
	K        int
	M        int
	PrivKey  string
	HexNonce string
}

AggProcessorConfig defines config given to the aggregation processor

type AggProcessorReq

type AggProcessorReq struct {
	Comm    *AggComm
	Config  AggProcessorConfig
	Context context.Context
}

AggProcessorReq defines request to the processor provider

type Command

type Command struct {
	Type int
	Seq  uint64
}

Command defines command from producer to consumer/processor

type MQ

type MQ struct {
	NeedProcessorCh   chan AggProcessorReq
	NeedProcessorResp chan error
	Comms             map[string]*AggComm
	// contains filtered or unexported fields
}

MQ defines this message queue

func NewMQ

func NewMQ() *MQ

NewMQ creates new MQ

func (*MQ) AskProcessor

func (mq *MQ) AskProcessor(ctx context.Context, apc AggProcessorConfig) (*AggComm, error)

AskProcessor as for aggregation processor. we currently only have slave syncer

type Response

type Response struct {
	Err error
}

Response defines response from consumer/processor to producer

Jump to

Keyboard shortcuts

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