gq

package module
v0.0.0-...-b868a91 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: BSD-2-Clause Imports: 1 Imported by: 0

README

=====
gq
=====

Message queue for experiments written in Go.


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerMessage

type ConsumerMessage struct {
	Message
	Id int64
}

ConsumerMessage message for a consumer

type MQ

type MQ interface {
	// Initialization
	Create() error
	// Destruction
	Destroy() error
	// Simple send message
	Publish(messages []*Message) error
	// Request a batch of messages
	ConsumeBatch(size int) ([]*ConsumerMessage, error)
	// Way to consume a stream of messages
	Stream(size int, messages chan []*ConsumerMessage, pause time.Duration)
	// End the stream
	StopConsumer()
	// Commit that a messages has been processed
	Commit(recipts []*Receipt) error
}

MQ Implemented message queue interface

type Message

type Message struct {
	Payload []byte
}

Message minimal message definition

type Receipt

type Receipt struct {
	Id      int64
	Success bool
}

Receipt to commit

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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