channelq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelEventQueue

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

ChannelEventQueue is the channel implementation of EventQueue

func NewChannelEventQueue

func NewChannelEventQueue(ctx *context.Context) (*ChannelEventQueue, error)

NewChannelEventQueue initializes a new ChannelEventQueue

func (*ChannelEventQueue) Close

func (q *ChannelEventQueue) Close(info *model.HubInfo) error

Close closes rChannel for given project and group

func (*ChannelEventQueue) Connect

func (q *ChannelEventQueue) Connect(info *model.HubInfo) error

Connect allocates rChannel for given project and group

func (*ChannelEventQueue) Consume

func (q *ChannelEventQueue) Consume(info *model.HubInfo) (EventSet, error)

Consume retrieves message from the rChannel for given project and group

func (*ChannelEventQueue) Publish

func (q *ChannelEventQueue) Publish(info *model.HubInfo, event *model.Event) error

Publish sends message via the rchannel to Edge Controller

func (*ChannelEventQueue) Workload

func (q *ChannelEventQueue) Workload() (float64, error)

Workload returns the number of queue channels connected to queue

type ChannelEventSet

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

ChannelEventSet is the channel implementation of EventSet

func NewChannelEventSet

func NewChannelEventSet(messages <-chan model.Event) *ChannelEventSet

NewChannelEventSet initializes a new ChannelEventSet instance

func (*ChannelEventSet) Ack

func (s *ChannelEventSet) Ack() error

Ack acknowledges once the event is processed

func (*ChannelEventSet) Get

func (s *ChannelEventSet) Get() (*model.Event, error)

Get obtains one event from the queue

type EventSet

type EventSet interface {
	Ack() error
	Get() (*model.Event, error)
}

EventSet holds a set of events

Jump to

Keyboard shortcuts

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