queue

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitManyAckQueues

func WaitManyAckQueues(queues ...*AckQueue) bool

Types

type AckQueue

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

func NewAckQueue

func NewAckQueue() *AckQueue

func (*AckQueue) Dispose

func (q *AckQueue) Dispose()

func (*AckQueue) Disposed

func (q *AckQueue) Disposed() bool

func (*AckQueue) Get

func (*AckQueue) GetMany

func (q *AckQueue) GetMany(max uint32) (res []UidDest)

func (*AckQueue) GetManyInto

func (q *AckQueue) GetManyInto(uids *[]UidDest)

func (*AckQueue) Has

func (q *AckQueue) Has() bool

func (*AckQueue) Put

func (q *AckQueue) Put(uid utils.MyULID, dest conf.DestinationType) error

func (*AckQueue) Wait

func (q *AckQueue) Wait() bool

type BSliceQueue

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

func NewBSliceQueue

func NewBSliceQueue() *BSliceQueue

func (*BSliceQueue) Dispose

func (q *BSliceQueue) Dispose()

func (*BSliceQueue) Disposed

func (q *BSliceQueue) Disposed() bool

func (*BSliceQueue) Get

func (q *BSliceQueue) Get() (bool, utils.MyULID, string, error)

func (*BSliceQueue) GetMany

func (q *BSliceQueue) GetMany(max uint32) (slices []string)

func (*BSliceQueue) GetManyInto

func (q *BSliceQueue) GetManyInto(slices *[]string, uids *[]utils.MyULID)

func (*BSliceQueue) GetManyIntoMap

func (q *BSliceQueue) GetManyIntoMap(m *map[utils.MyULID]string, max uint32)

func (*BSliceQueue) GetManySlicesInto

func (q *BSliceQueue) GetManySlicesInto(slices *[]string)

func (*BSliceQueue) Has

func (q *BSliceQueue) Has() bool

func (*BSliceQueue) Put

func (q *BSliceQueue) Put(uid utils.MyULID, m string) error

func (*BSliceQueue) PutSlice

func (q *BSliceQueue) PutSlice(m string) error

func (*BSliceQueue) Wait

func (q *BSliceQueue) Wait(timeout time.Duration) bool

type Data

type Data generic.Type

type KafkaProducerAck

type KafkaProducerAck struct {
	Offset int64
	TopicPartition
}

type KafkaProducerAckQueue

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

func NewKafkaProducerAckQueue

func NewKafkaProducerAckQueue() *KafkaProducerAckQueue

func (*KafkaProducerAckQueue) Dispose

func (q *KafkaProducerAckQueue) Dispose()

func (*KafkaProducerAckQueue) Disposed

func (q *KafkaProducerAckQueue) Disposed() bool

func (*KafkaProducerAckQueue) Get

func (*KafkaProducerAckQueue) Has

func (q *KafkaProducerAckQueue) Has() bool

func (*KafkaProducerAckQueue) Put

func (q *KafkaProducerAckQueue) Put(offset int64, partition int32, topic string) error

func (*KafkaProducerAckQueue) Wait

func (q *KafkaProducerAckQueue) Wait() bool

type KafkaQueues

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

func NewQueueFactory

func NewQueueFactory() *KafkaQueues

func (*KafkaQueues) Delete

func (qs *KafkaQueues) Delete(q *WrappedQueue)

func (*KafkaQueues) Get

func (qs *KafkaQueues) Get(qid uint32) *WrappedQueue

func (*KafkaQueues) New

func (qs *KafkaQueues) New() (q *WrappedQueue)

type Ring

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

Ring is a thread-safe bounded queue that stores Data messages.

func NewRing

func NewRing(size uint64) *Ring

NewRing will allocate, initialize, and return a ring buffer with the specified size.

func (*Ring) Cap

func (rb *Ring) Cap() uint64

Cap returns the capacity of this ring buffer.

func (*Ring) Dispose

func (rb *Ring) Dispose()

Dispose will dispose of this queue and free any blocked threads in the Put and/or Get methods. Calling those methods on a disposed queue will return an error.

func (*Ring) Get

func (rb *Ring) Get() (Data, error)

Get will return the next item in the queue. This call will block if the queue is empty. This call will unblock when an item is added to the queue or Dispose is called on the queue. An error will be returned if the queue is disposed.

func (*Ring) IsDisposed

func (rb *Ring) IsDisposed() bool

IsDisposed will return a bool indicating if this queue has been disposed.

func (*Ring) Len

func (rb *Ring) Len() uint64

Len returns the number of items in the queue.

func (*Ring) Offer

func (rb *Ring) Offer(item Data) (bool, error)

Offer adds the provided item to the queue if there is space. If the queue is full, this call will return false. An error will be returned if the queue is disposed.

func (*Ring) Poll

func (rb *Ring) Poll(timeout time.Duration) (Data, error)

Poll will return the next item in the queue. This call will block if the queue is empty. This call will unblock when an item is added to the queue, Dispose is called on the queue, or the timeout is reached. An error will be returned if the queue is disposed or a timeout occurs. A non-positive timeout will block indefinitely.

func (*Ring) PollDeadline

func (rb *Ring) PollDeadline(deadline time.Time) (Data, error)

func (*Ring) Put

func (rb *Ring) Put(item Data) error

Put adds the provided item to the queue. If the queue is full, this call will block until an item is added to the queue or Dispose is called on the queue. An error will be returned if the queue is disposed.

type TopicPartition

type TopicPartition struct {
	Partition int32
	Topic     string
}

type UidDest

type UidDest struct {
	Uid  utils.MyULID
	Dest conf.DestinationType
}

type WrappedQueue

type WrappedQueue struct {
	*KafkaProducerAckQueue
	// contains filtered or unexported fields
}

func (*WrappedQueue) ID

func (q *WrappedQueue) ID() uint32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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