litekfk

package
v0.0.0-...-667e438 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadPos_Empty = iota
	ReadPos_Default
	ReadPos_Latest
)
View Source
const (
	ReadPos_Resume = 256 + iota
	ReadPos_ResumeOrDefault
	ReadPos_ResumeOrLatest
)

Variables

View Source
var ErrDropOut = fmt.Errorf("Client have been dropped out")
View Source
var ErrEOF = fmt.Errorf("EOF")

Functions

func InitTopic

func InitTopic(conf *topicConfiguration) *topicUnit

func NewDefaultConfig

func NewDefaultConfig() *topicConfiguration

Types

type Client

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

func (*Client) Read

func (c *Client) Read(beginPos int) (Reader, error)

func (*Client) UnReg

func (c *Client) UnReg()

type Reader

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

func (Reader) AutoReset

func (r Reader) AutoReset(br bool)

func (Reader) Commit

func (r Reader) Commit() error

func (Reader) CurrentEnd

func (r Reader) CurrentEnd() *readerPos

func (Reader) Position

func (r Reader) Position() uint64

func (Reader) ReadBatch

func (r Reader) ReadBatch() ([]interface{}, error)

func (Reader) ReadFullBatch

func (r Reader) ReadFullBatch() ([]interface{}, error)

try to read full batch (at least one more item has been written after current batch) this method will locked and the only way to quit is calling the ReleaseWaiting in topic

func (Reader) ReadOne

func (r Reader) ReadOne() (interface{}, error)

func (Reader) Reset

func (r Reader) Reset()

func (Reader) Rollback

func (r Reader) Rollback() error

func (Reader) TransactionReadBatch

func (r Reader) TransactionReadBatch() []interface{}

func (Reader) TransactionReadOne

func (r Reader) TransactionReadOne() interface{}

type Topic

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

func CreateTopic

func CreateTopic(conf *topicConfiguration) Topic

func (Topic) Clients

func (t Topic) Clients() *clientReg

func (Topic) CurrentPos

func (t Topic) CurrentPos() uint64

func (Topic) DoPurge

func (t Topic) DoPurge(passed uint64)

func (Topic) NewClient

func (t Topic) NewClient() *Client

func (Topic) ReleaseWaiting

func (t Topic) ReleaseWaiting()

func (Topic) Watcher

func (t Topic) Watcher() TopicWatcher

func (Topic) Write

func (t Topic) Write(i interface{}) error

type TopicWatcher

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

obtain a topic wather, access some members without locking

func (TopicWatcher) Clients

func (t TopicWatcher) Clients() *clientReg

func (TopicWatcher) CurrentPos

func (t TopicWatcher) CurrentPos() uint64

func (TopicWatcher) DoPurge

func (t TopicWatcher) DoPurge(passed uint64)

func (TopicWatcher) GetStart

func (w TopicWatcher) GetStart() *readerPos

func (TopicWatcher) GetTail

func (w TopicWatcher) GetTail() *readerPos

func (TopicWatcher) ReleaseWaiting

func (t TopicWatcher) ReleaseWaiting()

func (TopicWatcher) Write

func (t TopicWatcher) Write(i interface{}) error

Jump to

Keyboard shortcuts

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